Rubik Combined Listings

Rubik Combined Listings Swatch - Accessibility

← Back to documentation

Rubik Combined Listings Swatch is built with accessibility as a core consideration. Every swatch type — visual, button, and dropdown — includes features that help customers using screen readers, keyboards, and other assistive technologies navigate and select product options.

Semantic HTML structure

The component uses meaningful HTML elements rather than generic <div> containers:

ARIA labels

Every interactive element includes an aria-label attribute so screen readers can announce what each control does:

Element ARIA attribute Example value
Visual swatch aria-label "Blue Cotton T-Shirt" (product title)
Button swatch aria-label "Red" (option value or product title)
Dropdown aria-label "Color" (the option name)
Overflow indicator (+n) aria-label "+5" (number of hidden swatches)

Active state indication

The currently selected swatch is announced to screen readers using aria-current="true". When a customer clicks a different swatch, the previous one loses the attribute and the new selection receives it. This lets assistive technology users know which option is currently active without relying on visual cues alone.

Group labeling

Swatch groups use ARIA group roles and label associations to provide context:

Keyboard navigation

All swatch types are fully operable with a keyboard:

Focus management

The component handles focus states carefully to balance visual clarity with usability:

Out-of-stock indication

Unavailable products are communicated through multiple channels, not just color or opacity:

Touch device support

The component adapts its behavior for touch devices:

Color independence

The component does not rely on color alone to convey information:

Browser compatibility

The component includes fallbacks to ensure accessibility features work across a wide range of browsers:

Feature Fallback
:focus-visible Standard :focus outline on older browsers
aspect-ratio Padding-bottom technique for Safari 14 and earlier
Flexbox gap Negative margin technique for older iOS Safari
backdrop-filter Solid background color on unsupported browsers

Summary of ARIA attributes used

Attribute Where used Purpose
aria-label All swatches, dropdowns, overflow indicator Announces the element's purpose to screen readers
aria-current="true" Active/selected swatch Indicates which option is currently selected
aria-hidden="true" Color SVGs, out-of-stock lines, placeholders Hides decorative elements from screen readers
aria-labelledby Swatch grids and carousels Associates the group with its visible label
role="group" Swatch grids and carousels Groups related swatches semantically
role="button" Overflow indicator (+n) Identifies a clickable non-link element as a button
tabindex="0" Overflow indicator (+n) Makes the element focusable via keyboard

Summary

Rubik Combined Listings Swatch provides accessible product navigation out of the box. Screen reader users hear descriptive labels and group context. Keyboard users can tab through and activate swatches. Touch users get appropriately adapted interactions. And all users benefit from multiple visual cues for selected and out-of-stock states that do not rely on color alone.

Related guides