ComponentsCarousels & media
Carousel
A row of cards you slide through, with snapping, round arrow buttons and dots.
This example uses sample data from this site: data.ts, which also needs art.ts. Copy those files from the repository, or use your own data in their place.
"use client";
import { Carousel, CarouselItem } from "@/components/miyuki-ui/carousel";
import { places } from "@/registry/lib/data";
export default function CarouselDemo() {
return (
<Carousel aria-label="Places to stay this winter" className="max-w-3xl">
{places.slice(0, 6).map((place) => (
<CarouselItem key={place.name}>
<img src={place.image} alt="" draggable={false} className="aspect-[4/3] w-full rounded-xl object-cover" />
<p className="mt-3 text-sm font-medium text-foreground">{place.name}</p>
<p className="text-[13px] text-muted-foreground">{place.region}</p>
</CarouselItem>
))}
</Carousel>
);
}Install
npx shadcn@latest add @miyuki-ui/carouselThis needs the @miyuki-ui registry in your components.json. See Using the shadcn CLI.
Props
Carousel
Prop
Type
CarouselItem
Prop
Type