Components
- Accordion
- Add to Cart
- Animated List
- Carousel
- Collapsible Sidebarnew
- Dynamic Island
- Expandable Cardnew
- Expanding Searchnew
- Filter Grid
- Kanban Board
- Layout Switcher
- Morphing Popover
- Number Flip
- Page Transition
- Product Gallery
- Segmented Control
- Sortable Table
- Stack Navigator
- Status Button
- Step Wizard
- Tabs
- Text Morphnew
- Theme Mode Switch
- Theme Morph Button
- Theme Toggle Button
- Theme Toggle Switch
- Theme Transition
- Toast Stacknew
Aurora Ridge
Lofoten, Norway
Copper Dunes
Wadi Rum, Jordan
Tide Pools
Azores, Portugal
Moss Canopy
Yakushima, Japan
Ember Fields
Etna, Italy
Installation
$ pnpm dlx shadcn@latest add @transition-kit/carouselUsage
import {
Carousel,
CarouselContent,
CarouselDots,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/transitions/carousel";<Carousel loop aria-label="Featured places">
<CarouselContent>
<CarouselItem className="border bg-card p-6">Aurora Ridge</CarouselItem>
<CarouselItem className="border bg-card p-6">Copper Dunes</CarouselItem>
<CarouselItem className="border bg-card p-6">Tide Pools</CarouselItem>
</CarouselContent>
<div className="flex items-center justify-between">
<CarouselPrevious />
<CarouselDots />
<CarouselNext />
</div>
</Carousel><Carousel loop autoplay={5000} aria-label="Featured places">
...
</Carousel>const [index, setIndex] = React.useState(0);
<Carousel index={index} onIndexChange={setIndex} aria-label="Screenshots">
...
</Carousel>;const Counter = () => {
const { count, index } = useCarousel();
return (
<span className="text-sm text-muted-foreground tabular-nums">
{index + 1} / {count}
</span>
);
};API Reference
Carousel
| Prop | Type | Default | Description |
|---|---|---|---|
index | number | - | Controlled slide on screen. |
defaultIndex | number | 0 | Initial slide when uncontrolled. |
onIndexChange | (index: number) => void | - | Called with the new slide index after each move. |
loop | boolean | false | Wraps from the last slide to the first and back. |
autoplay | number (ms) | - | Advances every N milliseconds. Pauses on hover, keyboard focus, a hidden tab and reduced motion; without loop it rewinds to the first slide after the last. The root gets data-autoplay="playing" or "paused". |
useCarousel
| Return | Type | Description |
|---|---|---|
index | number | The current slide index. |
count | number | The total number of slides. |
loop | boolean | Whether wrapping is on. |
playing | boolean | Whether autoplay is running. |
canPrevious | boolean | Whether moving back is possible. |
canNext | boolean | Whether moving forward is possible. |
goTo | (index: number) => void | Moves to the slide index. |
previous | () => void | Moves one slide back. |
next | () => void | Moves one slide forward. |