Zephora UI

Data

Carousel

Accessible slide show with arrow buttons, dot indicators, keyboard navigation, pointer swipe and optional auto-play that pauses on hover and focus.

Import

import { Carousel } from "@zephora/react";

Examples

Basic

Every direct child becomes one slide.

Loop and auto-play

`autoPlay` advances on an interval and pauses while hovered or focused; `loop` wraps around the ends.

Controlled index

Active slide: 1

API

Carousel props

PropTypeDefaultDescription
childrenReactNodeSlides — every direct child becomes one slide.
indexnumberControlled active slide index.
defaultIndexnumber0Initial slide for uncontrolled usage.
onIndexChange(index: number) => voidFires whenever the active slide changes.
loopbooleanfalseWrap from the last slide back to the first (and vice versa).
autoPlaynumberAuto-advance interval in ms. Pauses on hover and focus.
showArrowsbooleantrueRender previous/next arrow buttons.
showDotsbooleantrueRender dot indicators.
unstyledbooleanfalseHeadless mode — skips Zephora styling.

Keyboard

KeyAction
ArrowLeft / ArrowRightGo to the previous / next slide (root focused).
TabMoves between the root, arrows and dots. Inactive slides are inert.
Enter / SpaceActivates the focused arrow or dot button.