Skip to content
SevenUI
Sign in
On this page

Carousel

A carousel with motion and swipe built using Embla, with previous and next controls, horizontal and vertical orientation.

1
2
3
4
5

Installation

Bash

Usage

API reference

A thin wrapper over embla-carousel-react (pinned to ^8.6.0). ArrowLeft/ArrowRight scroll the carousel when the region has focus.

PropTypeDefault
optsembla EmblaOptionsType (loop, align, dragFree, …)—
pluginsembla plugin array (none ship with SevenUI — e.g. embla-carousel-autoplay)—
orientation"horizontal" | "vertical" — maps to embla’s axis"horizontal"
setApi(api: CarouselApi) => void — for dots/counters via api.on("select", …), api.scrollTo(i)—

CarouselContent and CarouselItem

The track and slides. Slide width is a basis-* utility on CarouselItem (basis-1/3 shows three per view); spacing is -ml-* on the content with a matching pl-* on items — embla reads margins, not CSS gap. Vertical carousels need an explicit height on the content (e.g. className="h-[200px]"), since embla measures the container.

CarouselPrevious and CarouselNext

Nav buttons rendered through Button; they disable automatically at the ends when loop is off.

Was this page helpful?