Embla-powered surface-aware carousel with horizontal or vertical orientation, optional arrows and dot pagination, keyboard navigation and reduced-motion support.
Built on embla-carousel with full opts and plugins pass-through
Horizontal or vertical orientation with arrow and dot navigation
Keyboard navigation (Arrow keys) and aria-roledescription="carousel" landmark
Surface-aware (pixel or linear) with focus-ring tokens
Honors prefers-reduced-motion by zeroing transition duration
Status
stable
Category
data
Since
v1.9.0
API
import { PixelCarousel } from '@pxlkit/ui-kit';
PixelCarousel
Prop
Type
Default
Description
opts
Omit<EmblaOptionsType, 'axis'>
—
Full embla options surface (see embla-carousel docs). Common subset: loop, align, slidesToScroll, startIndex, dragFree, containScroll, inViewThreshold. axis is set internally from orientation.
Receives the embla API once ready; called again with undefined on unmount.
orientation
'horizontal' | 'vertical'
'horizontal'
Slides side by side, or stacked.
showArrows
boolean
true
Previous and next buttons.
showDots
boolean
false
A dot per slide, to go to it.
surface
'pixel' | 'linear'
—
Surface override; defaults to the nearest provider.
aria-label
string
—
Accessible name for the carousel region (required for landmark navigation).
children* (required)
React.ReactNode
—
The slides (PixelCarousel.Item).
Also takes the native attributes and event handlers of <div> (HTMLAttributes<HTMLDivElement>).
ref points to <div>.
PixelCarousel.Item
Prop
Type
Default
Description
children* (required)
React.ReactNode
—
The slide's content.
Also takes the native attributes and event handlers of <div> (HTMLAttributes<HTMLDivElement>).
ref points to <div>.
Accessibility
WCAG target: 2.1 AA
carousel
Root element is role="region" with aria-roledescription="carousel" and a focusable tabIndex. Each item is role="group" with aria-roledescription="slide" and aria-label "Slide N of M". Previous/Next buttons declare aria-label and aria-controls pointing to the viewport id. A polite live region announces the current slide index without reading slide content (per APG carousel pattern). Dots expose aria-current="true" on the active slide.