What the component guarantees
- A radio group, because it is one choice of several. The row is
role="radiogroup"named bylabel, and each chip isrole="radio"witharia-checked. A screen reader announces the group's question, then each chip as "radio, 2 of 5, checked". Faking it with buttons gives none of that. - One tab stop. Tab lands on the chosen chip (or the first that can be chosen) and leaves the row on the next press, so a row of six chips costs a keyboard user one stop, not six.
- The arrow keys choose. ← → ↑ ↓ move to the next chip and choose it, wrapping at either end, Home and End jump to the first and last, and a disabled chip is skipped. In a right-to-left document → moves back, following reading order.
- The chosen chip is not only a colour. It swaps to the high-contrast fill, which reads in forced colours as a change of background, and
aria-checkedcarries the state to assistive technology. - The library's focus ring. Two bands, the ring colour outside and the surface inside, so it reads on the chosen chip's fill as well as on an unchosen one.
- A touch target on phones. The
hit-areamixin grows each chip's tap box to 44px on a phone touch screen without changing how it looks.
What you own
- A
labelthat asks the question the chips answer: "Limit search to a product", not "Filters". - Short chip labels. The chip's text is its whole accessible name.