Data display

Carousel
v0.1.21
Ready for Production

A carousel with motion and swipe interactions that allows content to be added in a modular way using Embla Carousel primitives.

Prefer AI-assisted development?

This documentation is available via the Catalyst MCP Server. Learn how to connect →

Catalyst Carousel is a flexible, accessible carousel built on top of Embla Carousel — giving you swipe interactions, keyboard navigation, and horizontal or vertical orientations with zero configuration.

Preview

Installation

npm install @pmi/catalyst-carousel

Common Patterns

Loop

Enable infinite looping by passing options={{ loop: true }} to CarouselRoot.

Preview

Vertical Orientation

Create a vertical scrolling carousel with the orientation="vertical" prop.

Preview

Drag Free

Allow free-form dragging without snap points using options={{ dragFree: true }}.

Preview

Variable Widths

Control individual slide widths with Tailwind basis-* utilities on CarouselItem.

Preview

Right-to-Left

Support RTL layouts by wrapping in a dir="rtl" container and passing options={{ direction: 'rtl' }}.

Preview

Slides to Scroll

Scroll multiple slides at once with options={{ slidesToScroll: 2 }}. Assign matching snapIndex values to group items.

Preview

Plugins

Autoplay

Automatically advance slides with the autoplay plugin.

The autoplay plugin requires a separate install: npm install embla-carousel-autoplay

Preview

Auto-scroll

Continuously scroll slides without snapping using the auto-scroll plugin.

The auto-scroll plugin requires a separate install: npm install embla-carousel-auto-scroll

Preview

A carousel layout optimized for displaying testimonials with images and text.

Preview

Disable drag on larger screens by conditionally setting options={{ watchDrag: false }}.

Preview

API Reference

Carousel is a compound component built on Embla Carousel primitives. The sections below summarize the API surface for each part.

CarouselRoot

The root container that provides context and configuration for the carousel. Accepts all standard div attributes, and asChild for composition with Radix Slot.

Prop

Type

CarouselContent

Container for carousel items that manages the scrollable area. Accepts all standard div attributes and forwards ref.

CarouselItem

Individual carousel slide container. Use Tailwind basis-* utilities (basis-1/2, basis-4/5, etc.) to control slide width.

Prop

Type

CarouselPrevious

Button to navigate to the previous slide. Accepts all standard button attributes. Receives data-[disabled] when at the boundary in non-loop mode.

CarouselNext

Button to navigate to the next slide. Accepts all standard button attributes. Receives data-[disabled] when at the boundary in non-loop mode.

CarouselControls

Layout container for pagination dots and navigation buttons. Accepts all standard div attributes.

CarouselPagination

Container for pagination dot indicators. Accepts all standard div attributes.

CarouselPaginationDot

Individual pagination indicator. Receives data-[selected] when its snap point is active.

Prop

Type

CarouselAnnounce

Visually hidden live region that announces slide changes to screen readers. Always include this in every carousel for accessibility.

Accessibility

Keyboard Interactions

KeyAction
TabMoves focus to navigation controls
Enter / SpaceActivate the focused previous/next button

ARIA

  • CarouselAnnounce renders a visually hidden live region — always include it so screen readers announce slide changes.
  • Navigation buttons receive descriptive labels; provide aria-label if using icon-only buttons without visible text.
  • data-[disabled] is applied to previous/next buttons at the carousel boundary — assistive technology reads these as disabled.
  • Catalyst adds styling and token-based focus indicators; Embla provides the underlying scroll and interaction semantics.

Choosing the Right Component

Use Carousel when you need a scrollable, swipeable sequence of items with pagination controls. Reach for a different component when:

If you need…Use instead
Toggle between views without scrolling or swipingTabs
Expand/collapse individual content panelsAccordion
A static grid of items without motion or navigation controlsa native CSS grid layout

On this page