Skip to Content
ComponentsSearch

Search

Search input with a dropdown results list. Keyboard navigation with Arrow keys, Enter to select, Escape to close. Supports loading state and empty state.

Preview

Anatomy

import { Search } from '@wire-ui/react' import type { SearchOption } from '@wire-ui/react' const options: SearchOption[] = [ { id: 'react', title: 'React' }, ] <Search.Root onSearchChange={setQuery} onSelect={(opt) => console.log(opt)} loading={isLoading}> <Search.Input placeholder="Search..." /> <Search.Content> {options.map((opt) => ( <Search.Item key={opt.id} option={opt}> {opt.title} </Search.Item> ))} <Search.Empty>No results found</Search.Empty> </Search.Content> </Search.Root>

Root props

PropTypeDefaultDescription
onSearchChange(query: string) => voidCalled on every keystroke
onSelect(option: SearchOption) => voidCalled when an item is selected
loadingbooleanfalseAdds data-loading to root
searchDelaynumber0Debounce delay for onSearchChange in ms

SearchOption type

type SearchOption = { id: string | number title: string subtitle?: string }

Item data attributes

AttributeWhen present
data-highlightedItem is keyboard-focused / active

Root data attributes

AttributeWhen present
data-loadingloading prop is true

Keyboard navigation

KeyAction
ArrowDownMove highlight down
ArrowUpMove highlight up
EnterSelect highlighted item
EscapeClose dropdown, clear highlight
Last updated on

MIT License © 2026 wire-ui