Carousel

Slides you swipe or step through with round arrow buttons, built on Embla.

@cupertinoui/carouselRegistry JSON

Installation

pnpm dlx shadcn@latest add @cupertinoui/carousel

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "@/components/ui/carousel"

<Carousel>
  <CarouselContent>
    <CarouselItem>…</CarouselItem>
  </CarouselContent>
  <CarouselPrevious />
  <CarouselNext />
</Carousel>

API Reference

Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.

PropTypeDescription
orientation"horizontal" | "vertical"
Default: "horizontal"
The direction of the slides.
opts / pluginsEmbla's options and plugins.
setApi(api) => voidGets Embla's API, e.g. to show the current slide.
classNamestringExtra classes, merged with the component's own.