Search Input
InputMITSearch-styled input with icon, clear button, and keyboard handling.
bun add @otfdashkit/ui
Preview
Search InputInput
Loading Storybook preview…
Code
@otfdashkit/uiimport React, { useState } from 'react'
import { SearchInput } from '@otfdashkit/ui'
function SearchDemo() {
const [val, setVal] = useState('')
return (
<div className="flex flex-col gap-4 max-w-sm">
<SearchInput placeholder="Search…" shortcut="⌘K" value={val} onChange={setVal} onClear={() => setVal('')} />
<SearchInput placeholder="Filter results" value={val} onChange={setVal} />
</div>
)
}
export function Example() {
return (
<SearchDemo />
)
}
Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.
Props
Props declared in the SearchInput source. Inherited HTML attributes are not listed.
| Prop | Type | Default | Description |
|---|---|---|---|
| onChange | (value: string) => void | ||
| onClear | () => void | ||
| shortcut | string |