Back to Components

Foundation

SearchInput

Pill search field built on Input — magnifier glyph leading, ⌘K hint or × clear button trailing.

Examples

Default

<SearchInput bind:value placeholder="Search · try author:turing" />

Custom shortcut

<SearchInput shortcutLabel="Ctrl+F" />

Without shortcut hint

<SearchInput showShortcut={false} />

Props

PropTypeDefaultDescription
valuestring''Bindable search string.
showShortcutbooleantrueShow the ⌘K hint when value is empty.
shortcutLabelstring'⌘K'Label for the shortcut hint.
onclear() => voidCalled when the × clear button is pressed.
...restHTMLInputAttributesSpread onto the underlying <input>.

Install

CLI

npx @a3tai/mittsu add search-input