Docs
Search

Search

Input field designed for search queries.

Installation

Usage

import { Search } from "@/components/ui/search";
const [value, setValue] = useState("");
 
<Search
  label="Search"
  value={value}
  onSearch={setValue}
  placeholder="Search products..."
/>;

Props

PropTypeDefaultDescription
labelReactNode-Label displayed above the search input
captionReactNode-Caption displayed below the search input
valuestring""Current value of the search input
onSearch(value: string) => void-Callback when search value changes
fullWidthbooleanfalseWhether the search should take up full width
classNamestring-The class name to apply to the component
inputClassNamestring-Class name applied to the input element
clearClassNamestring-Class name applied to the clear button
searchClassNamestring-Class name applied to the search icon wrapper
placeholderstring"Search..."Placeholder text when no input is present
placeholderSuggestionsstring[][]Suggestions that cycle through the placeholder
typingSpeednumber150Speed of typing animation in ms
deletingSpeednumber100Speed of deleting animation in ms