BridgeHandbookDraft
For agents
Menu
ExperimentalatomInputs

SearchInput

The pill search field with a clear button.

import { … } from "@brdgapp/ui/components/search-input"

Usage

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.

When to use

  • Searching a list, table or tab.

When not to use

  • For a general text field. Bridge's text input moves into the package later.

Anatomy

  1. Field. 40px tall pill on --surface-secondary; white when focused.

  2. Search icon. 16px; turns blue when the field has focus.

  3. Clear button. An IconButton, shown only when there's text and onClear is set.

Examples

Search people

Type to filter the sample network.

Try “Okonkwo”

States

RestFocus
Empty
Has text
StateWhat happens
RestGrey fill, light border.
FocusWhite fill, blue border and a soft blue ring; the icon turns blue.
Has textThe clear button appears.

Behavior

  • Built on Base UI Input, like Input, so it can sit inside a Field and gets the same keyboard and form behavior.
  • className goes on the wrapper, so a width limit keeps the clear button inside the pill.
  • Debounce the query (Bridge OS uses 300ms) and search on the server where the endpoint supports it.
  • Place the search row above the list's loading, empty and error states, so people can type while it loads.

Do and don't

Do

Search on the server, so every match is found.

Don't

Filter only the page already loaded and call it search.

Content

  • Placeholder: "Search {things}". It's a hint, not the label.

Accessibility

  • Give it an aria-label (or a visible label): the placeholder disappears when typing.
  • Announce the result count in a polite live region.
KeysAction
EscClears the field (the browser's search behavior).
TabReaches the clear button.

API reference

SearchInput

The search field. Extends Base UI Input props, the same as a text input (except type).

PropTypeDefaultDescription
valuestring—The query.
onChange(event) => void—Update the query.
onClear() => void—Clear it. Without this there's no clear button.
classNamestring—Layout only, on the wrapper.

Lineage

What it's built from and where it's used, read from the code. When you change it, check these too.

Built from
IconButton
Used by components
None
Used in templates
Table page

Known gaps

Where the code still differs from the system. Follow the system, not the gap.

  • Bridge OS's placeholder used --text-disabled (2:1). The package uses --text-muted (4.71:1).
  • Bridge OS's clear button was a hand-made 24px button; it is now IconButton (28px).

Sources

  • Bridge OS components.md → SearchInput; src/components/ui/search-input.tsx.