Skip to Content
✨ QuickCode UI keeps growing! More components, more features, and more ways to make your projects shine. Stay tuned & maybe… hire me or sponsor me 😉 
DocumentationSearchBox

SearchBox

A search input with built-in debouncing, loading states, and clear functionality.

Install Dependencies

npx
quickcode-ui add SearchBox

Default Usage

Search with Results

Props

PropTypeDefaultDescription
valuestringundefinedControlled input value.
onChange(value: string) => voidundefinedCalled when input value changes.
onSearch(value: string) => voidundefinedDebounced callback triggered after user stops typing.
loadingbooleanfalseShows loading spinner and disables input.
debounceMsnumber300Milliseconds to wait before triggering onSearch.
showClearButtonbooleantrueShows clear button (X) when input has value.
placeholderstring"Search..."Placeholder text for the input.
disabledbooleanfalseDisables the input and clear button.
classNamestringundefinedAdditional CSS classes for the wrapper div.
Last updated on