Skip to content

Carousel

A slideshow with motion and swipe support, built on Embla Carousel.

API Reference

Installation

pnpm dlx shadcn@latest add @frontal-labs/carousel

Usage

import {
  Carousel,
  CarouselContent,
  CarouselItem,
  CarouselNext,
  CarouselPrevious,
} from "@/components/ui/carousel";
<Carousel>
  <CarouselContent>
    <CarouselItem>Slide 1</CarouselItem>
    <CarouselItem>Slide 2</CarouselItem>
    <CarouselItem>Slide 3</CarouselItem>
  </CarouselContent>
  <CarouselPrevious />
  <CarouselNext />
</Carousel>

API Reference

Root component. Creates the Embla instance and shares it through context.

CarouselContent

The scroll container. Holds the CarouselItem elements.

CarouselItem

A single slide. Set a basis-* class to show more than one slide at a time.

CarouselPrevious

Scrolls to the previous slide. Disabled at the start unless the carousel loops.

CarouselNext

Scrolls to the next slide. Disabled at the end unless the carousel loops.

Examples

Multiple Slides

Vertical