The APG carousel, basic or tabbed, with native scroll snapping a page at a time, a mouse drag, and a rotation that focus stops, in each framework.
A set of slides shown a page at a time, one slide or several side by side. It is the APG
carousel in both its styles: the basic
carousel (Previous, Next and a group of picker buttons) and the tabbed one (the pickers a tablist,
the slides tabpanels). The slides scroll natively with CSS scroll snapping: a touch swipe or a
trackpad scrolls them, a mouse drags them.
Pages: a page starts at slide 0, then every slidesPerMove slides; the last page is always
full (it starts at slideCount - slidesPerPage). The out-of-view slides are inert and hidden
from assistive technology.
Changes: Previous and Next (previous-press, next-press; disabled at the edges unless
loop), an Indicator (item-press), a tabbed Indicator's keys (keyboard), the rotation
(autoplay), a mouse drag (drag) and any other scroll you make (swipe, once it settles).
Rotation: playing rotates the pages every delay, wrapping to the first. Focus entering
the carousel stops it (focus-in) until the AutoplayTrigger starts it again; the pointer
over it (but the AutoplayTrigger) pauses it, and leaving resumes it with the time it had
left. The slides' container is aria-live="off" while rotating, "polite" otherwise.
Tabbed: variant="tabbed": the APG tabs' keys (the arrows select and wrap, Home and End),
one slide per page.
Layout: the ItemGroup lays the slides out and scrolls them (a structural style: a grid, its
scrolling axis, the snapping, no visible scrollbar); give it a width (and a height when
vertical). --carousel-slides-per-page and --carousel-spacing are on the Root.
No text: name the Root, the slides ("2 of 4"), the triggers and the Indicators; the
AutoplayTrigger's label follows its state.
Every part also takes what the primitive contract gives:
render (Vue: as and the render slot), a class and a style, a ref, and any attribute, which
it forwards. Vue binds them as props (v-model:page, v-model:playing, :slide-count), and
Angular as inputs ([(page)], [(playing)], [slideCount]).
role="region", aria-roledescription="carousel"; data-orientation; data-playing while rotating; data-paused while a hover pauses it
ItemGroup
aria-live="off" while playing, "polite" otherwise; aria-atomic="false"; tabindex="0" while its slides hold nothing Tab reaches; data-orientation; data-dragging
Item
basic: role="group", aria-roledescription="slide"; tabbed: role="tabpanel"; out of view inert and aria-hidden="true"; data-inview; data-index
PrevTrigger, NextTrigger
type="button"; aria-controls the ItemGroup; disabled and data-disabled at an edge
Tab and Shift+Tab move through the controls and the in-view slides. In the tabbed variant the
IndicatorGroup is one tab stop: the arrows (swapped in RTL) select the next or previous tab and
wrap, Home and End the first and last.