Component librarySearch input

Search input

Free

Search with clear, loading and results states.

npx shadcn@latest add https://tidalui.com/r/search-field.json
Desktop viewport

Installation

Terminal
npx shadcn@latest add https://tidalui.com/r/search-field.json

Import components/ui/tidal.css, components/ui/search-field.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.

Usage

Complete example source · Dependency and asset manifest

Loading the complete example…

API & behavior

Required visible label, controlled value:string and onValueChange(string). Optional onSearch(string) handles unmodified Enter; without it native form submission remains available. Native type=search input props/ref, name, required, disabled, readOnly, id, className(input) and rootClassName supported; no wrapper form is rendered. Clear button and Escape clear editable values and retain input focus; disabled/readOnly omit clear. Keyboard handlers compose with caller onKeyDown and honor preventDefault. Composition ref, isComposing and keyCode229 protect IME Enter/Escape. Optional description, pending, resultCount(finite values floor/clamp nonnegative; omitted/nonfinite hides count), error, announce(defaultfalse). Help/status IDs compose with aria-describedby; error sets aria-invalid and role=alert, pending sets aria-busy and limits decorative looping to pending. Other status announcements opt in. Native clear decoration is suppressed in WebKit so one clear control remains; reserved slot prevents query-width shifts. Reduced motion stops sweeps/transitions. Consumers own matching, debounce, requests, composition-aware work scheduling, results and focus after selection.

Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.

Building with an agent?Give it the installation guide and component catalog.