Carousel
Swipe through, one at a time — or use the arrows and the arrow keys.
Preview
Five places, five landscapes
Usage
tsx
import { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext } from "zostel-ui";
<Carousel>
<CarouselContent>
<CarouselItem>…</CarouselItem>
<CarouselItem>…</CarouselItem>
</CarouselContent>
<CarouselPrevious />
<CarouselNext />
</Carousel>Carousel
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" | Which way it moves; arrow keys and swipes follow. |
className | string | — | More classes, merged with the component’s own (tailwind-merge). |
orientationType:
"horizontal" | "vertical"Default:
"horizontal"Which way it moves; arrow keys and swipes follow.
classNameType:
stringDefault: —
More classes, merged with the component’s own (tailwind-merge).
Parts
| Prop | Type | Default | Description |
|---|---|---|---|
CarouselContent | div | — | The track: swipeable, snapping, scrollbar hidden. |
CarouselItem | div | — | One slide (full width; set basis-1/2 etc. for more per view). |
CarouselPrevious / CarouselNext | Button | — | Round arrows over the edges; disabled at the ends. |
CarouselContentType:
divDefault: —
The track: swipeable, snapping, scrollbar hidden.
CarouselItemType:
divDefault: —
One slide (full width; set basis-1/2 etc. for more per view).
CarouselPrevious / CarouselNextType:
ButtonDefault: —
Round arrows over the edges; disabled at the ends.
Motion
A tap on an arrow slides one page smoothly — or instantly for people who ask their device for reduced motion.