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
childrenReactNode—Slides — every direct child becomes one slide.
indexnumber—Controlled active slide index.
defaultIndexnumber0Initial slide for uncontrolled usage.
onIndexChange(index: number) => void—Fires whenever the active slide changes.
loopbooleanfalseWrap from the last slide back to the first (and vice versa).
autoPlaynumber—Auto-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.