# Drag Carousel

> A carousel you can throw: it keeps the momentum of your flick, then springs to the nearest slide, with a progress bar and arrow controls.

Category: Layout · MotionKit Plus · Updated 2026-11-12 · Live demo: https://www.motionkitui.com/components/drag-carousel

## When to use it

Photo and product galleries, case studies, testimonials, travel and portfolio sites, and app onboarding screens.

## How it works

The track is a Motion element dragged on the x axis within constraints worked out from the slide width, gap and viewport, so the last slide stops at the edge. On release, the drag's velocity projects where a flick would carry it, and the track springs to the nearest slide to that point. The progress bar reads the same motion value, so it moves with your finger, and the arrow keys and buttons step one slide at a time.

## Installation

Part of MotionKit Plus (https://www.motionkitui.com/pricing). Subscribers install it with `npx shadcn@latest add @motionkit/drag-carousel` after adding their registry token from https://www.motionkitui.com/account.

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `slides` | `{ title; caption?; image?; alt?; color? }[]` | `six samples` | The slides. Without an image, color is used as the background. |
| `children` | `ReactNode[]` |  | Your own slides instead; each child is one slide. |
| `slideWidth` | `number` | `260` | Slide width in pixels. |
| `gap` | `number` | `16` | Space between slides in pixels. |
| `accent` | `string` | `"#5FAEB4"` | Colour of the progress bar. |
| `label` | `string` | `"Gallery"` | Names the carousel for screen readers. |

## Accessibility

- **Keyboard: Pass.** Previous and next buttons, plus the arrow keys when the carousel has focus, with a visible focus ring.
- **Screen readers: Pass.** Marked up as a carousel of labelled slides ("3 of 6: Desert dunes"), and the current slide is announced as it changes.
- **Reduced motion: Pass.** With reduced motion on, slides jump into place without momentum or springs.
- **Colour contrast: Pass.** Slide titles and captions sit on a dark scrim, measuring 14.7:1 or more.
