search bar
Search bar component with keyboard shortcuts (Ctrl+K) and modal support
Installation
Choose your preferred installation method. CLI is recommended for the fastest setup.
1
Quick Install
One command, zero configuration
$ npx @hritik-sharmaa/repeat-ui add commons-search-bar --variant ts-tailwind
Props Table
Configuration options and properties for this component.
Prop | Type | Default | Description |
---|---|---|---|
placeholder | string | "Search..." | Placeholder text displayed in the search input field and trigger button. |
className | string | "" | Additional CSS classes to apply to the search container wrapper. |
enableHotkey | boolean | true | Whether to enable Ctrl+K (or Cmd+K) keyboard shortcut to open/close the search modal and show the hotkey badge. |
enableModal | boolean | true | Whether to show search results in a modal. When false, displays inline search input that triggers onSearch callback on each keystroke. |
onSearch | (query: string) => void | undefined | Callback function called when search is performed. In modal mode, triggered on Enter key. In inline mode, triggered on each keystroke. |