Getting Started
Foundations
Components
Search for a command to run...
Carousels (also called sliders) display multiple pieces of content in a rotating sequence, allowing users to browse through items one at a time. They're commonly used for image galleries, product showcases, testimonials, or featured content. Carousels support both horizontal and vertical orientations, keyboard navigation, touch gestures, and automatic sliding.
Built on top of Embla Carousel with smooth animations, touch/swipe support, keyboard navigation (Arrow keys), and accessibility support including proper ARIA attributes and roles.
import { Carousel } from "@strongtie/design-system/carousel"This module exports the following components:
CarouselApiCarouselCarouselContentCarouselItemCarouselPreviousCarouselNext<Carousel>| Prop | Type | Default | Description |
|---|---|---|---|
opts | Partial<OptionsType> | - | |
orientation | horizontal | vertical | horizontal | |
plugins | CreatePluginType<LoosePluginType, {}>[] | - | |
setApi | ((api: EmblaCarouselType) => void) | - |
<CarouselPrevious>| Prop | Type | Default | Description |
|---|---|---|---|
size | default | sm | lg | icon | icon | The size of the button, affecting padding and font size. |
variant | link | default | secondary | outline | ghost | destructive | outline | The visual style variant of the button. |
<CarouselNext>| Prop | Type | Default | Description |
|---|---|---|---|
size | default | sm | lg | icon | icon | The size of the button, affecting padding and font size. |
variant | link | default | secondary | outline | ghost | destructive | outline | The visual style variant of the button. |
Components can be styled using the className prop. The design system uses Tailwind CSS for styling.
The following data attributes are used to identify component parts:
carouselcarousel-contentcarousel-itemcarousel-nextcarousel-previousOther CSS classes used by this component:
-horizontal-verticalcarouselcarousel-contentcarousel-content-itemscarousel-itemcarousel-nextcarousel-previoushorizontalsr-onlyEnsure proper accessibility attributes are added when implementing this component.