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.

PropTypeDefaultDescription
placeholderstring"Search..."Placeholder text displayed in the search input field and trigger button.
classNamestring""Additional CSS classes to apply to the search container wrapper.
enableHotkeybooleantrueWhether to enable Ctrl+K (or Cmd+K) keyboard shortcut to open/close the search modal and show the hotkey badge.
enableModalbooleantrueWhether to show search results in a modal. When false, displays inline search input that triggers onSearch callback on each keystroke.
onSearch(query: string) => voidundefinedCallback function called when search is performed. In modal mode, triggered on Enter key. In inline mode, triggered on each keystroke.