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 2px focus-ring drawn 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-label in 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.