Inputs
Search field
A search field is the pill a person types into to find payments, tasks and events; put it at the top of anything that can be searched.
In kanso-ui as SearchField
Variants and sizes
- Search pill (
k-search): one size. Empty, it shows the placeholder; filled, it adds the clear button.
States
- Rest: the placeholder in
ink-muted. - Hover: only the cursor changes.
- Focus: the ring goes around the whole pill (
k-search:focus-within), a 2pxfocus-ringdrawn 2px outside, because the pill is the control people see; the input draws no ring of its own. Focus shows as a shape, the ring, not as a change of fill. - Filled: the value in
ink, and the clear button. Clear search and Escape both empty the field and keep focus in it. - No results: say so in the results, not in the field.
Do and don’t
Do
Name what can be found: "Search payments, tasks, events".
Keep the
aria-labelin the placeholder's words.Keep the query when the person opens a result and comes back.
Don’t
Drop the search icon; with the placeholder, it is what marks the pill as a field.
Clear the query when the field loses focus.
What you provide
- Placeholder, and the same words for the
aria-label. - The value, and what happens on input, submit and clear.