Overview
Installation
Usage
Variants
Multiple Items Visible
With Dots Indicator
Autoplay
API Reference
Carousel
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"witharia-label="carousel" CarouselPreviousandCarouselNexthavearia-label="Previous slide"/"Next slide"- Keyboard: Arrow Left/Right navigate slides when carousel is focused
CarouselItemhasrole="group"witharia-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: truewith Autoplay so users can read without pressure - Set
basis-1/2orbasis-1/3for 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