SearchInput handbook
v1.3.1 · @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 single-line input with a search icon for filtering lists, searching pages, and entering queries in toolbars.
When to use it
Use it to enter a query directly, such as filtering a list. Use SearchBox for the entry to a global search popup. The host decides how the query filters data; prefer TableToolbar for a DataTable toolbar.
bind:valuesynchronizes input. The page decides how to filter application data.Default
as="search"integrates with Listbox or Popover search regions. Chooseborderlesswithin an existing surface to avoid a duplicate border or background.
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
Host component specialization
The real
Inputis SearchInput’s visual and interactive host. Compatible Input Props are passed as flat Props; there is noparts.Input.Props derive from
ComponentProps<typeof Input>. SearchInput owns and explicitly forwardsvalue,defaultValue,type,as,class, andchildrento the host.Inputstill owns native input events, ARIA, disabled/readonly/invalid states, Frame capabilities, and base appearance. SearchInput adds only default search semantics, the default search icon, and specializedborderlessstyling.There is no extra wrapper. The real
Inputremains the root host and emits each event once.The error
Textgenerated insideInputcan still be configured with flatparts.Text.
SearchInput specializes Input for searching. Apart from default type="search" and a default leading Search icon, its color, hover/focus states, clear X, three-slot layout, and Frame capabilities match Input.
Feature overview
Uses the Components built-in icon named
searchby default. An application-level IconProvider or explicit leading content can replace it.The built-in Search icon uses Black/20 at rest and Black/40 while input is active; this color rule belongs only to SearchInput.
Explicit leading content replaces the default icon.
collapseBelowshows only the search icon when this component becomes too narrow. Minimum width is actual horizontal padding plus the leading Icon’s intrinsic width. An empty, unfocused input collapses; focus or a value restores it.Clear X, hover, focus, disabled, readonly, invalid, and default error shake behavior come from
Input.The inner
Inputconnects root capabilities toFrame.
Core Props
Popup usage
SearchInput defaults to as="search". Within <Popover> or <Listbox>, the inner Input moves into the fixed popup header through LISTBOX_HEADER_PORTAL_KEY context, gaining compact styling, no outer focus ring, and separation from the scrollable results. SearchInput does not own Listbox filtering; use <Input as="search"> directly when Listbox filtering is required.
Usage examples
This section is protected. An AI must request user review before modifying it.
SearchInput 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.
SearchInput types and states
Required Props: no named required Props.
Two-way binding: bind:value, bind:element.
Inherited declaration: Omit<InputProps, ControlledInputKeys>. 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.
InputProps
Source: components/src/components/SearchInput.svelte
ControlledInputKeys
Source: components/src/components/SearchInput.svelte