Ballmac UI home

Carousel

A swipeable, keyboard-operable carousel on Embla with slide labels, dot pagination, vertical mode, loop, and autoplay that pauses on hover, focus and reduced motion.

Ship faster

Preview every change on its own URL before it reaches customers.

One workspace

Projects, files and approvals live together, with a full history.

See what matters

Usage and performance in one dashboard, updated as it happens.

Secure by default

Roles, audit logs and two-step sign-in are on from day one.

Installation

$ pnpm dlx shadcn@latest add @ballmac/carousel

Usage

import { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, CarouselDots, CarouselPlayPause, useCarousel } from "@/components/ballmac/carousel"

The full example is in the Code tab above.

Examples

1Design
2Build
3Review
4Launch
5Measure
6Learn
Press ⌘K to search
Drag to reorder
Hold Shift to select a range

API reference

<Carousel>

PropTypeDefault
childrenReact.ReactNode—
opts

Embla options, for example `{ loop: true, align: "start" }`.

CarouselOptions—
orientation

Direction of travel.

"horizontal" | "vertical""horizontal"
setApi

Receives the Embla API once it is ready, for custom controls.

(api: NonNullable<CarouselApi>) => void—
autoplay

Advance on a timer, in milliseconds (`true` = 5000). Pauses on hover and focus, and never runs under reduced motion. Pair it with `CarouselPlayPause`.

boolean | numberfalse
label

Accessible name of the carousel region.

string—

<CarouselContent>

PropTypeDefault
viewportClassName

Classes for the clipping viewport around the track.

string—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
ArrowLeft / ArrowRightPrevious or next slide (Up / Down when vertical)
TabReaches arrows, dots and the pause button
Swipe / dragMoves slides with touch or mouse

Use with AI

Compose Carousel, CarouselContent and CarouselItem with CarouselPrevious, CarouselNext, CarouselDots and CarouselPlayPause. Give Carousel a label. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Carousel (@ballmac/carousel) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Feature highlights and testimonials
  • Product image galleries
  • Horizontal lists that overflow

Not for

  • Content people must read in full; show it all
  • A marquee of logos; use marquee

Registry JSON: https://ui.ballmac.com/r/carousel.json

Credits

Based on shadcn/ui Carousel, adapted by Ballmac. Free to use in personal and commercial projects.