Skip to content
uiify

Carousel

Slide carousel with touch gestures and previous and next controls.

Browsers
Chrome 123+Firefox 121+Safari 17.5+
Tier
2
Bundle compressed
7.17 kB
Forced layout budget
0 ms
Axe budget
0
SSR compatible
Yes
Published contract
Test harness

Playground

Carousel

Featured cards

Move between stories with the arrows or select a slide with the dots.

Responsive card rail

Right to left

Block axis

Synchronized controls and native commands

Autoplay with Stop and Start

Focus stops rotation until Start is pressed. Hover pauses temporarily.

Optional mouse drag

Fade with CSS transitions

API

Carousel

CarouselClient — @gunkin/uiify/components/carousel/client

PropTypeDefaultDescription
defaultValue / valuenumber—Initial or controlled item index; observed settled state drives controls.
rewindbooleanfalseWrap finite ends without cloned slides.
mouseDragbooleanfalseOpt-in mouse drag. Touch and wheel remain native.
autoplayboolean | CarouselAutoplayOptionsfalseDelay defaults to 5000ms. Options: delay, paused, cycles and stopOnInteraction. Includes visible Stop/Start.
onSelect / beforeChange / afterChange / onSwipecallbacks—Report actual settled changes and reasons; see the Carousel guide for controlled and interrupted-motion semantics.
refRef<CarouselClientHandle>—next, previous, goTo, start, stop and reset.

FadeCarouselClient — @gunkin/uiify/components/carousel/fade

PropTypeDefaultDescription
swipebooleantrueTouch/pen swipe; mouse requires mouseDrag. Inherits client props except axis. Inactive slides are inert.

Keyboard

KeyAction
Tab / EnterFocus and follow native slide links; enhanced buttons activate with Space too
Arrow keysUse native scrolling while the viewport is focused

Accessibility

The base Carousel is a server component with native scrolling, snapping and finite fragment navigation. The interactive /client entry is Tier 2: synchronized dots, persistent arrows, callbacks, autoplay and mouse drag require hydration; /fade adds CSS opacity transitions. Focus stops autoplay until Start, hover pauses temporarily, and reduced motion disables automatic rotation by default. The CSS-generated-controls lab is experimental.

Styling hooks

data-uiify-carouseldata-axisdata-enhanceddata-modedata-carousel-indexdata-statedata-dragging--uiify-carousel-slide-size--uiify-carousel-gap--uiify-carousel-fade-duration