Components

Search box

Unofficial Experimental

A single-line, form field for searching, with submit button.

(Heavily inspired by the Search component in the GOV.UK Component Guide.)

Rendering...
Rendering...
Props
NameTypeDefaultDescription

Stories

Standard

A standard Search box.

Rendering...
<SearchBox name="q" />

Custom label

Rendering...
Rendering...

Hint

If you provide a hint, it will be displayed instead of the label.

Rendering...
Rendering...

Custom submit button text

The text of the submit button is visually hidden, but can be customised for screen-readers.

Rendering...
Rendering...

Fixed width

Rendering...
Rendering...

Fluid width

Rendering...
Rendering...

Error

Currently errors are visually hidden, so it is best to avoid them. They will however be accessible to screen-readers, and the field will still be highlighted in red.

Rendering...
Rendering...

Disabled

Rendering...
<SearchBox disabled name="q" />

Secondary button

A search box with a more subtle, grey button, similar to the 'secondary' button style.

Rendering...
Rendering...