# Carousel

> A slideshow for cycling through images or cards (embla-carousel).

_Updated: 2026-06-04_

A slideshow for cycling through images or cards (embla-carousel).

## Installation

```bash
railbase ui add carousel
```

Peer dependencies:

```bash
npm install embla-carousel
```

> [!NOTE]
> `railbase ui add` also copies the `button` component — they ship alongside this component automatically.

## Usage

```tsx
import { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext } from "@/lib/ui/carousel";

<Carousel>
  <CarouselContent>
    <CarouselItem>Slide 1</CarouselItem>
    <CarouselItem>Slide 2</CarouselItem>
  </CarouselContent>
  <CarouselPrevious />
  <CarouselNext />
</Carousel>
```

## Anatomy

Exported parts: `useCarousel` · `Carousel` · `CarouselContent` · `CarouselItem` · `CarouselPrevious` · `CarouselNext`
