Carousel
A carousel with motion and swipe built using Embla, with previous and next controls, horizontal and vertical orientation.
Installation
Bash
Usage
API reference
Carousel
A thin wrapper over
embla-carousel-react (pinned to
^8.6.0). ArrowLeft/ArrowRight scroll the carousel when the region
has focus.
| Prop | Type | Default |
|---|---|---|
opts | embla EmblaOptionsType (loop, align, dragFree, …) | — |
plugins | embla 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.