ThiloDesign System
DV

Carousel

shadcn/ui
Embla

Horizontal slideshow built on Embla. For galleries, attachments, onboarding steps.

@/components/ui/carousel

Default — one item per view

1
2
3
4
5

Multi-item — 3 per view (basis-1/3)

1
2
3
4
5
6
7
8

In context — ticket attachment viewer

T7A3763 attachments
5 files
Open
ticket-report.pdf
screenshot.png
export-data.xlsx
error-log.txt
network-trace.har

Use arrow keys or click the buttons to browse all 5 attachments

Embla options (opts prop)

OptionTypeDescription
align"start" | "center" | "end"Where items snap to within the container
loopbooleanWrap around from last to first slide
dragFreebooleanFree-form drag without snapping
slidesToScrollnumberHow many items to advance per click

Sub-components

ComponentRole
CarouselRoot — wraps Embla. Accepts opts (Embla options) and orientation
CarouselContentSliding track — contains all CarouselItems
CarouselItemSingle slide. basis-* controls how many show per view
CarouselPreviousBack button — absolute positioned, requires relative parent space
CarouselNextForward button — absolute positioned, requires relative parent space

Control how many items show per view with Tailwind basis-* on CarouselItem: basis-full (1), basis-1/2 (2), basis-1/3 (3).

On this page