Scroll-snapping slides you move with buttons, dots, arrow keys or by dragging with the mouse.
pnpm dlx shadcn@latest add @latheui/carouselPart of Lathe Pro. Set up your project once with your license key: npx latheui init --key <key>. See Lathe Pro.
Carousel is part of Lathe Pro
The preview is live and free to try. The source, the install and every assembly come with Pro: $79 once, with lifetime updates.
Depends on
Also accepts native section attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
| label* (required) | string | — | Accessible name of the carousel. |
| showDots | boolean | true | Shows the dot navigation. |
| onIndexChange | (index: number) => void | — | Called with the index of the slide nearest the start edge. |
| trackClassName | string | — | Classes for the scrolling track, for example gap-6. |
| children* (required) | ReactNode | — | CarouselItem elements. |
One slide. Accepts native div attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | "basis-full" | Set the slide width with a basis class. |
<Carousel label="Testimonials" trackClassName="gap-6">
<CarouselItem className="basis-4/5 md:basis-1/3">…</CarouselItem>
</Carousel>