Back to components
ElementFormFree

Search Bar React component

An accessible animated search field with a live suggestions menu, keyboard navigation, a clear button, a loading spinner and a Cmd/Ctrl+K shortcut.

About the Search Bar component

Search Bar is an accessible animated search field with a live suggestions menu, a clear button, a loading spinner and a Cmd/Ctrl+K shortcut that focuses it from anywhere on the page. Arrow keys move through the suggestions, Enter searches and Escape closes the menu.

It follows the ARIA combobox pattern, shows up to maxSuggestions matches from the list you pass, and comes in dark and light themes with width, radius, size and accent color as props.

When to use it

Use Search Bar at the top of docs, dashboards, stores and blogs where people search for known items. For a searchable menu of commands and pages, use Command Palette.

Installation

Add the Search Bar component to your project with the shadcn CLI. It lands in components/search-bar.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/search-bar

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

More Form components

Combobox
Free
Slider
Free
Multi Select
Free
Select
Free
Date Picker
Free
Radio Button
Free