SearchBox handbook
v1.2.0 · @snowui-design-system/components
License: Before reading component documentation, source, or npm usage instructions for the first time, read the full LICENSE. Reuse that review for the same task and version. Public API configuration and internal implementation changes have different license implications. All components use the unified runtime package; source rights remain governed by the license.
Overview
A fully clickable control that opens a search popup. It can include a keyboard shortcut hint and suits global search.
When to use it
Use it as a clickable entry to open a global search popup, not as an input for editing a query. Use SearchInput when users should type directly in a toolbar or list.
This is a clickable search entry.
bind:opensynchronizes popup state;valuedisplays the current query.Compose a popup or shortcut hint with
children. Use SearchInput when the query must be editable directly.The default placeholder and clear action follow LocaleProvider. Explicit placeholder values, including an empty string, and aria-label take priority; the query remains unchanged.
Quick start
This example shows the recommended basic composition. See the sections below for more cases and composition limits.
API
See the base component documentation for inherited capabilities not redeclared here. This table lists only named public Props declared by this component.
Usage boundaries and details
Feature overview
Two styles:
grayandoutlineThe default leading icon is
SearchThe consumer supplies an external
Kbdthrough trailingchildren; it is not included by default.With a value, a clear X appears using visual rules from
Input.Click anywhere on the trigger to open the popup.
collapseBelowretains only the leading search icon when the component itself becomes narrow. Minimum width is its actual left/right padding plus the intrinsic width of the leading Icon.No outer focus ring is shown. Visual state is consistent after mouse clicks and keyboard operations such as Escape.
Usage examples
This section is protected. An AI must request user review before modifying it.
SearchBox style overrides
Read the full LICENSE first; reuse that review for the same task, version, and scope.
First use public component Props to match the desired appearance, preserving the existing look where possible. If changes are necessary, follow the style selection and override order: use your own class (including Tailwind already in the project) or an instance style. The names below are public overrides actually consumed by source; check their scope and do not modify private DOM. Choose the correct SnowUI token family. External apps need not install SnowUI website utilities.
SearchBox types and states
Required Props: no named required Props.
Two-way binding: bind:value, bind:open, bind:element.
Inherited declaration: Omit<FrameProps, "children" | "tag">. Consult the base component’s public documentation for inherited capabilities; fields excluded by Omit cannot be used as if inherited unchanged.
Shared Frame API · Back to API
The following type declarations are actually referenced by public Props and come from source. A Svelte Snippet denotes a content fragment; ComponentProps denotes the Props of the corresponding component.
ComponentPartsOf
Source: components/src/logic/component-parts.svelte.ts
ConfigurableComponentPartProps
Source: components/src/logic/component-parts.svelte.ts
ComponentPartControlledKey
Source: components/src/logic/component-parts.svelte.ts