Skip to content

Search

Stable

Search input and results panel for product discovery. Combines a text input with an optional filter control and a type-ahead results dropdown.

Examples

The Search component combines a text input with an optional filter control and a type-ahead results panel. It handles product discovery across the full catalogue.

Sizes

Two sizes to fit different layout contexts. Use sm (36px) in compact toolbars or headers; use md (40px) as the default in the main navigation bar.

Small — 36px

Search for products, brands, parts…

Medium — 40px

Search for products, brands, parts…

States

Four interaction states: default (idle), focused (active input with teal border), filled (has a value and shows clear button), and disabled.

Default

Search for products, brands, parts…

Focused

Search for products, brands, parts…

Filled

brake pads

Disabled

Search for products, brands, parts…

With filter control

Enable hasFilter to show a Filters button between the text input and the search button. This opens a filter panel (not part of this component) for narrowing results by category, price, or brand.

Search for products, brands, parts…

With results panel

When a query is entered, a dropdown results panel appears below the input. Results are grouped by section label and include a 'View all results' footer link.

brake
Products
Brake Pad Set — Front AxleBrakes & Suspension
Brake Disc — Vented, 280mmBrakes & Suspension
Brake Fluid DOT 4 — 500mlFluids & Lubricants
View all results for "brake"

Empty state

When no results match the query, the results panel shows a helpful empty state message. Suggest alternative actions to help the user continue their journey.

xyz123abc

No results for "xyz123abc"

Try a different search term or browse by category.

Interactive demo

Try typing into the search input below to see the live results panel. This demonstrates the full flow: empty → typing → results dropdown.

Anatomy

Search for products, brands, parts…
① Container② Icon③ Input④ Filter⑤ Button

① Container

Full-width, 1.5px border, radius-8, height 36–40px

② Search icon

Leading 16×16 icon; teal when focused

③ Text input

Flex-grow, placeholder text, 13px

④ Filter pill

Optional — tune icon + "Filters" label, left separator

⑤ Search button

Teal bg, right-radius only, icon + label

States

All input states rendered together. The focused state shifts the border to teal and changes the leading icon colour. The disabled state uses a grey background and prevents interaction.

Default — idle input waiting for user interaction

Search for products, brands, parts…

Focused — active, teal border and icon

Search for products, brands, parts…

Filled — has value, clear button visible

brake pads front axle

Disabled — non-interactive, reduced opacity

Search for products, brands, parts…

Design tokens

TokenValueDescription
background/surface
#ffffff
Panel and input background
background/brand/primary
#318272
Search button fill
text/primary
#3b3b3d
Input text
text/placeholder
#656565
Placeholder text
text/brand
#207264
Focused icon + "View all" link
text/inverse
#ffffff
Search button icon and label
border/default
#cccccc
Default input border
radius/md
8px
Input and results panel corner radius

Props

PropTypeDefaultDescription
size"sm" | "md""md"Height of the search input. sm=36px, md=40px.
state"default" | "focused" | "filled" | "disabled""default"Visual state of the input — controls border colour, icon colour, and clear button visibility.
hasFilterbooleanfalseShow a Filters pill button between the input and the search button.
placeholderstring"Search…"Placeholder text shown when the input is empty.
valuestring""Current input value. Controls whether the clear button is shown.
onSearch() => voidCallback fired when the search button is clicked or Enter is pressed.
onClear() => voidCallback fired when the clear (×) button is clicked.

Content guidelines

Do

  • Use descriptive placeholder text that sets expectations — e.g. "Search for products, brands, or part numbers"
  • Show results immediately as the user types — aim for sub-200ms response
  • Group results by category using section labels for scanability
  • Always include a "View all results" footer link so users can see the full set
  • Retain the query in the input after navigating to results so users can refine it

Don't

  • Don't show more than 6–8 results in the dropdown — it becomes overwhelming
  • Don't hide the search button — always provide a visible submit action
  • Don't lose the user's query when they press Escape or click away
  • Don't use vague empty states like 'Nothing found' — suggest next steps
  • Don't debounce aggressively — users expect instant feedback