TidalUI

Search input preview

Search with clear, loading and results states.

free · Forms · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

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

Import components/ui/tidal.css, components/ui/search-field.css. Wrap installed components in tidal-scope.

Preview

Search input component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/search-field.css";
import{TidalSearchField}from"./components/ui/search-field";
export default()=><div className="tidal-scope"><TidalSearchField label={"Demo"} onValueChange={() => {}} value={"value"}/></div>;

API and props

TidalSearchField.label (required)
string

Required label value accepted by this exported component.

TidalSearchField.onValueChange (required)
(value: string) => void

Callback invoked when the value change interaction is proposed.

TidalSearchField.value (required)
string

Required value value accepted by this exported component.

TidalSearchField.announce
boolean | undefined

Optional announce value accepted by this exported component.

TidalSearchField.description
string | undefined

Optional description value accepted by this exported component.

TidalSearchField.error
string | undefined

Optional error value accepted by this exported component.

TidalSearchField.onSearch
((value: string) => void) | undefined

Callback invoked when the search interaction is proposed.

TidalSearchField.pending
boolean | undefined

Optional pending value accepted by this exported component.

TidalSearchField.resultCount
number | undefined

Optional result count value accepted by this exported component.

TidalSearchField.rootClassName
string | undefined

Optional root class name value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas