MiHCM
layout/@mihcm/ui·v0.21.0·stable

Carousel

Composable carousel powered by Embla. Supports horizontal/vertical orientation, loop, and prev/next controls.

WCAG 2.1 AA — release blocker

Carousel must satisfy these on every render before it ships.

Semantics

  • The carousel container renders role="region" with aria-roledescription="carousel".
  • Each slide renders role="group" with aria-roledescription="slide".
  • The current slide is announced via aria-label (e.g. "1 of 5").

Keyboard navigation

KeyAction
Arrow LeftMove to the previous slide (horizontal).
Arrow RightMove to the next slide (horizontal).
Arrow UpMove to the previous slide (vertical).
Arrow DownMove to the next slide (vertical).
TabMove focus to the next interactive element.

Focus management

  • Previous/Next buttons are focusable and receive visible focus rings.
  • Focus does not move into off-screen slides.
  • Buttons are disabled (and announced as such) when at the first or last slide.

Labelling

  • CarouselPrevious and CarouselNext have aria-label defaults ("Previous slide", "Next slide").
  • Provide a descriptive aria-label on the Carousel when the context is not obvious.

Disabled state

  • At the first slide, the previous button has aria-disabled="true".
  • At the last slide, the next button has aria-disabled="true".
  • When loop is enabled, neither button is ever disabled.

Audit checklist

  • Container has role="region" with aria-roledescription="carousel"
  • Each slide has role="group" with aria-roledescription="slide"
  • Arrow keys navigate between slides
  • Previous/Next buttons have accessible labels
  • Disabled buttons announced as aria-disabled
  • Focus ring visible on all interactive elements
  • 4.5:1 contrast on controls