Content
- Placeholder: "Search {things}". It's a hint, not the label.
The pill search field with a clear button.
import { … } from "@brdgapp/ui/components/search-input"SearchInput is Bridge's search field: a pill with a search icon on the left and a clear button on the right once there's text. It is controlled: you own the value. The usual mistake is filtering only the rows already loaded when the server can search everything.
Field. 40px tall pill on --surface-secondary; white when focused.
Search icon. 16px; turns blue when the field has focus.
Clear button. An IconButton, shown only when there's text and onClear is set.
Type to filter the sample network.
Try “Okonkwo”
| Rest | Focus | |
|---|---|---|
| Empty | ||
| Has text |
| State | What happens |
|---|---|
| Rest | Grey fill, light border. |
| Focus | White fill, blue border and a soft blue ring; the icon turns blue. |
| Has text | The clear button appears. |
className goes on the wrapper, so a width limit keeps the clear button inside the pill.Do
Search on the server, so every match is found.Don't
Filter only the page already loaded and call it search.aria-label (or a visible label): the placeholder disappears when typing.| Keys | Action |
|---|---|
| Esc | Clears the field (the browser's search behavior). |
| Tab | Reaches the clear button. |
SearchInput
The search field. Extends Base UI Input props, the same as a text input (except type).
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | The query. |
onChange | (event) => void | — | Update the query. |
onClear | () => void | — | Clear it. Without this there's no clear button. |
className | string | — | Layout only, on the wrapper. |
What it's built from and where it's used, read from the code. When you change it, check these too.
Where the code still differs from the system. Follow the system, not the gap.
--text-disabled (2:1). The package uses --text-muted (4.71:1).components.md → SearchInput; src/components/ui/search-input.tsx.