Components

Search Input

Allows users to enter a search query. Wraps a text input in a search form with a built-in clear button.

Replacing soon
GitHub

Anatomy

Anatomy
import {SearchInput} from '@staffbase/design';

<SearchInput />;

Examples

Small size

Use height="32px" for compact layouts.

API reference

SearchInput accepts all standard HTML <input> attributes in addition to the props below.

NameTypeDescription
onClear
() => void
Called when the clear (×) button is clicked. Use this to reset the input value.
onSubmit
() => void
Called when the search form is submitted (e.g. Enter key pressed).
height
32px40px
Controls the height of the search input.
Default:'40px'
cancelButtonTitle
string
The `title` and `aria-label` of the clear button.
Default:'Cancel'
autoFocus
boolean
Focuses the input on mount.
Default:false
inputRef
RefObject<HTMLInputElement>
Ref for the underlying `<input>` element.