Skip to content

Accessibility

Pill Buttons are interactive components that combine text and optional icons to trigger an action. Because they are often used in dynamic contexts such as filters, tag selections, or overlays, it’s essential that they remain fully perceivable, operable, and understandable across all devices and assistive technologies.

To ensure Pill Buttons meet accessibility standards across platforms, please follow this implementation checklist. These recommendations align with WCAG 2.2 AA and EN 301 549 standards, supporting keyboard navigation, screen readers, and assistive technologies.

  • Use semantic <button> elements for all Pill Buttons.
  • Each button must include a descriptive text label that indicates its action or purpose.
  • When used as filters or toggles, use aria-pressed="true/false" to communicate state to assistive technologies.
  • Decorative icons must be hidden from screen readers (aria-hidden="true").
  • Do not use <div> or <span> styled as buttons — these break keyboard navigation and ARIA semantics.
  • Buttons must be focusable via Tab and activatable with Enter or Space.
  • Maintain a visible focus state at all times, following the visual reading order.
  • Avoid intercepting default keyboard behaviour (e.g. arrow keys for lists or filters).
  • Avoid animations that trigger on hover or focus without user interaction.
  • Respect the user’s prefers-reduced-motion system setting to prevent motion sickness or discomfort.
  • Transitions should be subtle and non-essential to understanding the state change.
  • Ensure the button text is always exposed to assistive technology — don’t replace it entirely with an icon.
  • Provide clear ARIA roles and states for interactive variants (e.g. filters, tags, toggles).
  • For asynchronous actions (spinners or loaders), add aria-busy="true" until the action completes.
  • Use aria-live="polite" regions for dynamic status updates if the button triggers content changes.
  • All Pill Buttons must be tested using automated accessibility tools such as Axe, Lighthouse, or Accessibility Insights before release.
  • Verify focus visibility under both light and dark modes.
  • Manually test with keyboard and screen readers to ensure expected behaviour.

To ensure accessibility and ease of interaction across devices, all interactive elements — including Pill Buttons — must respect a minimum touch target size.

Absolute minimum: 24 × 24 px — This is the lowest technical requirement referenced in accessibility documentation. It ensures that the component can still be reached, but does not guarantee an optimal experience for all users.

Recommended best practice: 44 × 44 px — This follows WCAG 2.5.5 Target Size (Level AA) and EN 301 549 guidance. Provides a more comfortable interaction area for users with motor difficulties, touch devices, or when using a device outdoors. Should be considered the default requirement in our design system.

The minimum target size applies regardless of the visual size of the Pill Button. If the visible area is smaller, add invisible padding to meet the accessibility requirement. Maintain consistent spacing between pills to prevent overlapping touch areas. Consistency is key: apply the same rule across all sizes (LG, MD, SM).

Guidance on how to use a component.
  • Add invisible padding around Pills when needed to expand the touch target (without altering the visual appearance).
  • Ensure Pills remain easily tappable in responsive layouts and on mobile contexts.
  • Keep sufficient spacing between adjacent Pills (≥ 8 px horizontally / 4 px vertically).
Guidance on what to avoid when using a component.
  • Do not rely solely on the visible shape to define the touch area.
  • Do not define touch areas smaller than 24 × 24 px (even for compact Pills).
  • Avoid placing multiple Pills so close that their touch areas overlap, as this may hinder accessibility.

Pill Buttons can trigger an action or represent a selectable state — for example, when used as filters or tags. Their text must clearly describe what they do or what they represent, keeping phrasing short, accessible, and easy to translate.

  • Use 1–2 words for filters, 1–3 words for actions.
  • Keep copy short and scannable to support responsive behaviour.
  • Use clear, specific text that communicates either an action (e.g. Apply, Show all) or a state (e.g. Electric, In stock).
  • Do not use generic or meaningless labels such as OK, Click, Select, or Filter.
  • The label should make sense on its own — users shouldn’t need to read nearby text to understand it.
  • Keep text under 24–30 characters to maintain consistency across translations and responsive layouts.
  • Allow flexibility for longer words in languages such as German or Finnish.
  • Do not truncate button text: use text wrapping when necessary to preserve meaning and accessibility.
  • Use clear, neutral phrasing that can be easily localised.
  • Avoid idioms, humour, or culture-specific references that might not translate well.
  • Always use sentence case (e.g. Apply filter, not APPLY FILTER).
  • Avoid punctuation unless strictly necessary (e.g. no full stops).
NameApplied asApplied to
buttons-pill-button-neutral-rested-border-color
Border colorPill Button
buttons-pill-button-neutral-rested-border-color
Border colorPill Button
buttons-pill-button-neutral-rested-foreground-color
Text colorButton label
buttons-pill-button-neutral-rested-foreground-color
Text colorButton label
buttons-pill-button-neutral-hover-fill-color
Background colorPill Button
buttons-pill-button-neutral-hover-fill-color
Background colorPill Button
buttons-pill-button-neutral-hover-foreground-color
Text colorButton label
buttons-pill-button-neutral-hover-foreground-color
Text colorButton label
buttons-pill-button-neutral-selected-fill-color
Background colorPill Button
buttons-pill-button-neutral-selected-fill-color
Background colorPill Button
buttons-pill-button-neutral-selected-foreground-color
Text colorButton label
buttons-pill-button-neutral-selected-foreground-color
Text colorButton label
buttons-pill-button-neutral-disabled-fill-color
Background colorPill Button
buttons-pill-button-neutral-disabled-fill-color
Background colorPill Button
buttons-pill-button-neutral-disabled-foreground-color
Text colorButton Label
buttons-pill-button-neutral-disabled-foreground-color
Text colorButton Label
color-border-focus-neutral-default
Border colorPill Button
color-border-focus-neutral-default
Border colorPill Button
NameApplied asApplied to
Lorem Ipsum
buttons-sm-font-size
Text styleButton Label
Lorem Ipsum
buttons-sm-font-size
Text styleButton Label
Lorem Ipsum
buttons-md-font-size
Text styleButton Label
Lorem Ipsum
buttons-md-font-size
Text styleButton Label
Lorem Ipsum
buttons-lg-font-size
Text styleButton Label
Lorem Ipsum
buttons-lg-font-size
Text styleButton Label