Search field
A search field narrows a list as you type. Put it above the list it searches and name that list in the placeholder.
6 candidates
- Bishnu TamangWelder, Nepal
- Priya NairCare assistant, India
- Maricel SantosCare assistant, Philippines
- Marko PetrovićElectrician, Serbia
- Emina HodžićWelder, Bosnia and Herzegovina
- Anil GurungWarehouse operative, Nepal
When to use it
Use a search field to find records in a list on the screen: candidates, companies, the items of a board. The placeholder names the list, such as Search candidates.
To search all of WerkOS, use the command palette. To choose one value in a form, use a combobox.
Anatomy
The search field is a text field with a search icon at its start. The clear button appears once there is text and empties the field in one press.
In a toolbar the field has no visible label, so its accessible name repeats the placeholder.
- Fill and focus
- as the text field
- Height
- 44 px
- Height in a toolbar, with a mouse
- 36 px
- Search icon
- 16 px, 12 px from the start
- --text-muted
- Text starts at
- 36 px
- Clear button
- 32 px, 6 px from the end
- Corner radius
- 8 px
- --radius-lg
How results arrive
Results follow the typing from the second character, a moment after the last key, and a line under the field says how many there are. The earlier results stay on screen and dim while the next ones load, so the list does not blank on each key. Enter keeps the query in the browser history, so Back returns to it.
- Wait after the last key
- 120 ms
- Shortest query
- 2 characters
- Earlier results while loading
- dimmed to 60 percent
- Loading indicator
- only after 150 ms
Keyboard
The slash works when focus is not already in a field.
- /
- Moves focus to the search field
- Escape
- Clears the text, then leaves the field
- Enter
- Keeps the query in the history
- Down arrow
- Moves into suggestions, when the field has them
On a phone
On a phone, search is a mode. Tapping the field widens it across the header, hides the other controls and shows Cancel. Cancel empties the field and brings the header back.
Permitted and not permitted
Permitted
Search candidates
The recruiter knows what the results will hold.
Not permitted
Search, on its own, in a module with several lists
The recruiter has to guess what is being searched.