nook
Browse the docs

Components

Carousel

Native

Slides in a row that scroll sideways and snap into place.

See the prompt
We replaced three tools and our weekly planning takes half the time.
Maya ChenDesign lead, Nook
Reports that the whole team can read without asking me what they mean.
Arif RahmanEngineering manager, Northwind
Setup took an afternoon. We have not touched the config since.
Lena FischerFounder, Globex
Support answers within the hour, every time.
Sam OkaforOperations, Initech

Installation

npx nook-ui@latest add carousel

Prompt

Paste this into your AI coding assistant. It adds this exact component, the same way the CLI does, and tells the assistant how to use it.

Short. For assistants that can run commands in your project.

Plain text
Add the Nook "Carousel" component to this project, exactly as Nook ships it.

Slides in a row that scroll sideways and snap into place.

Steps
1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`.
2. Run `npx nook-ui@latest add carousel`. It writes `components/ui/carousel.tsx` together with everything the component needs. Do not write the component from memory.
3. If you cannot run commands, fetch http://localhost:3000/r/carousel.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`.
4. Use it where I ask. Start from this example:

```tsx
import { Carousel, CarouselItem } from "@/components/ui/carousel";

const STORIES = [
  { quote: "We replaced three tools and our weekly planning takes half the time.", name: "Maya Chen", role: "Design lead, Nook" },
  { quote: "Reports that the whole team can read without asking me what they mean.", name: "Arif Rahman", role: "Engineering manager, Northwind" },
  { quote: "Setup took an afternoon. We have not touched the config since.", name: "Lena Fischer", role: "Founder, Globex" },
  { quote: "Support answers within the hour, every time.", name: "Sam Okafor", role: "Operations, Initech" },
];

export default function CarouselDefault() {
  return (
    <Carousel aria-label="Customer stories">
      {STORIES.map((story) => (
        <CarouselItem key={story.name} className="sm:basis-[calc(50%-0.5rem)]">
          <figure className="flex h-full flex-col justify-between gap-6 rounded-lg border-(length:--edge) border-(--field-edge) bg-card p-5">
            <blockquote className="text-base leading-relaxed text-pretty">{story.quote}</blockquote>
            <figcaption className="text-sm">
              <span className="font-medium">{story.name}</span>
              <span className="block text-muted-foreground">{story.role}</span>
            </figcaption>
          </figure>
        </CarouselItem>
      ))}
    </Carousel>
  );
}
```

API
- `Carousel`: The row and its controls.
  - `aria-label` (`string`): Names the carousel.
  - `hideDots` (`boolean`): Hide the row of dots.
- `CarouselItem`: One slide. Set a width such as `basis-1/2` to show several at once.

Rules
- Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them.
- Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme.
- It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles.
- Accessibility: A named region of slides, each announced with its position. Swipe, use the buttons, the dots or the arrow keys. It never moves by itself.

Done when the component renders like the example in light and dark mode and the project type-checks.

Usage

import { Carousel, CarouselItem } from "@/components/ui/carousel";

const STORIES = [
  { quote: "We replaced three tools and our weekly planning takes half the time.", name: "Maya Chen", role: "Design lead, Nook" },
  { quote: "Reports that the whole team can read without asking me what they mean.", name: "Arif Rahman", role: "Engineering manager, Northwind" },
  { quote: "Setup took an afternoon. We have not touched the config since.", name: "Lena Fischer", role: "Founder, Globex" },
  { quote: "Support answers within the hour, every time.", name: "Sam Okafor", role: "Operations, Initech" },
];

export default function CarouselDefault() {
  return (
    <Carousel aria-label="Customer stories">
      {STORIES.map((story) => (
        <CarouselItem key={story.name} className="sm:basis-[calc(50%-0.5rem)]">
          <figure className="flex h-full flex-col justify-between gap-6 rounded-lg border-(length:--edge) border-(--field-edge) bg-card p-5">
            <blockquote className="text-base leading-relaxed text-pretty">{story.quote}</blockquote>
            <figcaption className="text-sm">
              <span className="font-medium">{story.name}</span>
              <span className="block text-muted-foreground">{story.role}</span>
            </figcaption>
          </figure>
        </CarouselItem>
      ))}
    </Carousel>
  );
}

Examples

Product row

Harbor lamp

$64

Linen throw

$48

Oak tray

$36

Brass hook set

$22

Tips without dots

Tip 1 of 3Press Cmd K to search anything.

Tip 2 of 3Star a report to pin it to your home page.

Tip 3 of 3Drag a card to another column to change its status.

Long testimonials

We moved our whole support team over in a weekend. The migration notes alone saved us a week of guessing, and nobody had to learn a new tool from scratch.
Priya N., Head of support
The review flow is the first one my designers actually enjoy. Comments stay attached to the thing they are about, even after three rounds of changes.
Tomás R., Design lead
Short, plain and fast. I open it, do my one thing and close it again.
Hannah K., Founder

Props

The row and its controls.

PropTypeDefaultDescription
aria-labelstring–Names the carousel.
hideDotsboolean–Hide the row of dots.

CarouselItem

One slide. Set a width such as `basis-1/2` to show several at once.

Accessibility

A named region of slides, each announced with its position. Swipe, use the buttons, the dots or the arrow keys. It never moves by itself.

Checked against WCAG 2.1 AA with automated axe tests and keyboard tests on every release.