Skip to main content

Overview

Slide 1
Swipeable carousel content
Carousel displays content in a swipeable, scrollable strip. Built on Embla Carousel, it supports touch/mouse drag, keyboard navigation, autoplay, and loop modes.

Installation


Usage


Variants

Multiple Items Visible

With Dots Indicator

Autoplay


API Reference

EmblaOptionsType
Embla Carousel options. Common keys: loop, align, dragFree, slidesToScroll.
EmblaPluginType[]
Embla plugins array (e.g. Autoplay, AutoScroll).
string
default:"horizontal"
Scroll direction. Values: horizontal · vertical
(api: CarouselApi) => void
Callback to access the Embla carousel API for programmatic control.

CarouselItem

string
Use Tailwind basis-* classes to control item width (e.g. basis-1/2 for 2 visible items).

Accessibility

  • Carousel uses role="region" with aria-label="carousel"
  • CarouselPrevious and CarouselNext have aria-label="Previous slide" / "Next slide"
  • Keyboard: Arrow Left/Right navigate slides when carousel is focused
  • CarouselItem has role="group" with aria-label="Slide N of M"
  • Autoplay carousels must pause on focus and hover per WCAG 2.1

Do’s & Don’ts

Do

  • Show navigation arrows and dots for discoverability
  • Use opts={{ loop: true }} for image galleries and testimonials
  • Use stopOnInteraction: true with Autoplay so users can read without pressure
  • Set basis-1/2 or basis-1/3 for product card carousels

Don't

  • Don’t autoplay without giving users a way to pause
  • Don’t use Carousel for critical information — users may not see hidden slides
  • Don’t use for navigation — use Tabs or a sidebar instead
  • Don’t make slides too tall — users expect to see the next slide peeking in