preskok/ui

Carousel

Embla-based carousel with content items and accessible previous/next controls.

Installation

pnpm dlx @preskok-org/ui@latest add carousel

Usage

import { Carousel } from "@/registry/preskok/ui/preskok-ui/carousel"
 
export function CarouselDemo() {
  return (
    <Carousel className="w-full max-w-md">
      <Carousel.Content>
        {[1, 2, 3].map((n) => (
          <Carousel.Item key={n}>
            <div className="aspect-square p-4">{n}</div>
          </Carousel.Item>
        ))}
      </Carousel.Content>
      <Carousel.Handler>
        <Carousel.Button segment="previous" />
        <Carousel.Button segment="next" />
      </Carousel.Handler>
    </Carousel>
  )
}

Props

ComponentKey Props
Carouselorientation, opts, plugins, setApi
Carousel.Content-
Carousel.Item-
Carousel.Handler-
Carousel.Buttonsegment ("previous" | "next"), button props