Skip to content

Accessibility

The search field targets WCAG 2.1 AA and is exposed as a search landmark.

  • While placeholders are helpful, ensure the search context is clear. Use an aria-label if a visible label is not used in the layout. Source: WCAG 3.3.2 Labels or Instructions.
  • Never remove or obscure the blue focus ring; it is essential for users navigating via keyboard. Source: WCAG 2.4.7 Focus Visible.
  • Ensure the text inside the input meets a 4.5:1 contrast ratio against the background, in both contained and divided. Source: WCAG 1.4.3 Contrast (Minimum).

Use role="search" for the surrounding container, and aria-expanded="true|false" on the collapsed variant’s trigger. There are no keyboard traps: users must always be able to move focus away using Tab or Shift + Tab. Source: WCAG 2.1.2 No Keyboard Trap.

The interactive area must be at least 44 px in height to support touch accessibility. The large variants provide a minimum interaction area of 44 px, optimizing the experience for touch devices and improving targets for users with limited motor skills. Source: WCAG 2.5.8 Target Size (Minimum).

Key Action
Tab Move focus into and out of the search field
Enter / Space Trigger the search, when the search icon functions as a button
Escape When expanded or showing suggestions, collapse the field or clear the text

The input, then the clear button, then each item in the slot. Collapsed, the search icon is the only stop, and Space or Enter activates it.

  1. 1 — Input
  2. 2 — Clear
  3. 3 — Suggestion
  4. 4 — Suggestion
  5. 5 — Suggestion

Source: WCAG 2.4.3 Focus Order.

Figma leaves the slot open, and the list in its samples is only an example. Whatever it holds belongs to the search, so the landmark goes around both the field and the slot: a <search> element or a role="search" wrapper, rather than role="search" on the field. Name the landmark, and keep each item focusable so it takes Tab.

<search aria-label="Models">
<form class="tng-search-field">
<i
class="tng-icon icon-search tng-search-field-icon"
aria-hidden="true"
></i>
<input
class="tng-search-field-input"
type="search"
placeholder="Search for a model"
aria-label="Search for a model"
value="Cor"
/>
<button
class="tng-search-field-button"
type="button"
aria-label="Clear search"
>
<i class="tng-icon icon-close" aria-hidden="true"></i>
</button>
</form>
<ul class="tng-list tng-has-dividers" aria-label="Suggestions">
<li class="tng-list-option">
<a href="#slot-content">Corolla</a>
</li>
<li class="tng-list-option">
<a href="#slot-content">Corolla Cross</a>
</li>
</ul>
</search>

Search field

role="search" on the surrounding container.

Input

A visible label, or an aria-label if the layout has none. Truncating the text doesn’t affect how screen readers announce it.

Collapsed trigger

aria-expanded="true|false".

Source: WCAG 4.1.2 Name, Role, Value.