← Components/primitives

Search

Specialized text input with magnifying glass icon and clear button. Carbon-spec.

primitivesstablea11y: untested2/3 coverageEdit on GitHub ↗
primitives-search--defaultOpen all variants →

When to use

  • Any input that filters / queries a list — top-of-list search bars, command palettes, autocomplete entry points.
  • The clear button auto-shows when there's a value; pair with onClear to reset state.

When not to use

  • Plain single-line text → use `TextInput`.
  • Searchable + selectable list of options → use the ComboBox pattern.
  • Spotlight-style global command surface → use the CommandPalette pattern.