Resonance Logo

Variant Selector

A variant selector lets users choose product options — such as size and color — using a radio-group pattern with roving tabindex, providing a single tab stop, arrow-key navigation, and clear programmatic indication of selected, unselected, and unavailable states.

Demo

Tab into the size and color option groups below. Use the arrow keys to move between options within each group and press Space to select an option. Notice how the selected state and unavailable states are communicated as you navigate. Try toggling between groups with Tab to verify each group has a single tab stop.

Size
S M L XL Out of stock
Color
Black Blue Red Out of stock

What to Observe

Anatomy

[Anatomy image placeholder — will be added when assets are available]

  1. Variant group: A labeled container (e.g., "Size" or "Color") that wraps a set of mutually exclusive options; uses a radio group or equivalent pattern.
  2. Group label: A visible heading or label that names the attribute being selected; programmatically associated with the group's option set.
  3. Option button / radio: An individual selectable control representing a single variant value (e.g., "Medium" or "Blue"); keyboard-navigable via arrow keys.
  4. Selected state indicator: The visual and programmatic marker on the currently chosen option; announced by screen readers when the option receives focus.
  5. Unavailable state indicator: A visual and programmatic disabled or unavailable marker applied to options that cannot be selected due to stock or configuration constraints.

Accessibility Behavior

Common Mistakes

Why This Matters

Choosing a size or color is a mandatory step before adding most products to the cart. If a keyboard user must Tab through every size and color option individually, the interaction becomes exhausting on pages with many variants. If a screen reader user cannot tell which size is currently selected, or whether a color is unavailable, they may add the wrong variant to their cart and only discover the error at checkout. Accessible variant selectors ensure that all users can configure a product to meet their needs efficiently and with confidence before committing to a purchase.

Accessibility Validation

This component is validated against internal accessibility criteria aligned with WCAG standards, using our internally developed system, Resonance Specs.

To learn more, please contact us.

Code

Reference Implementation