Skip to content

Pips

Pips

Pip indicators provide an accessible way to navigate between items in a carousel or similar component. They use native radio inputs styled to provide a visual indicator of the current selection.

The pip indicators are built using native HTML radio inputs, providing built-in accessibility and state management without JavaScript. Each pip expands when selected and includes proper ARIA labels for screen readers.

CSS Variables

VariableDefault ValueDescription
--control-pip-size12pxSize (width/height) of individual pip indicators
--control-pip-active-width36pxWidth of the active/selected pip
--control-pip-gap8pxSpace between pip indicators
--control-pip-ring-width2pxWidth of the outline/focus ring around pips
--control-pip-ring-offset2pxOffset distance of the outline/focus ring
--control-pip-scale1.1Scale factor for pip hover/focus effect
--control-pip-mobile-size10pxSize of pip indicators on mobile devices
--control-pip-mobile-active-width30pxWidth of active/selected pip on mobile devices
--control-pip-transitionvar(--duration-speed-default)Transition timing for standard pip state changes
--control-pip-swap-transitionvar(--duration-speed-slow)Transition timing for pip selection changes

Accessibility

Implemented Accessibility Features

  • Complete keyboard navigation support through native radio controls
  • Semantic structure using radiogroup role
  • Clear descriptive labels for navigation (“Show item X of Y”)
  • Purpose description via aria-description for keyboard usage
  • Screen reader context through sr-only class
  • Visual focus indicators through native radio states
  • Proper use of semantic HTML with <label> elements
  • Current state indication through native radio checked state
  • Content relationships via aria-controls
  • Touch-friendly target sizes through label wrapping
  • Motion-respecting animations using prefers-reduced-motion
  • Consistent naming patterns across all controls

Accessibility Considerations when Implementing

  • Ensure radio input names are unique per instance
  • Match aria-controls values with corresponding content IDs
  • Maintain proper tab order matching visual presentation
  • Consider auto-advance pause on focus/hover
  • Handle dynamic content updates appropriately
  • Maintain state synchronization between controls and content