NK

Search

Search pages, posts, and components

All components

Carousel

Navigation

A slide carousel with arrows and dot indicators.

Ship faster

Installation

Add it with the shadcn CLI:

$pnpm dlx shadcn@latest add https://nawalkattel.com.np/r/carousel.json
Or install manually
  1. 1. Install dependencies

    pnpm add motion clsx tailwind-merge lucide-react
  2. 2. Copy the component source into components/library/carousel.tsx

Props

PropTypeDefaultDescription
slidesReactNode[] - Slides to cycle through.
classNamestring - Classes applied to the frame.

Accessibility

  • Arrows and dots are real buttons with aria-labels naming their target.
  • Slide direction drives the enter and exit transforms, so motion reads correctly.
  • Wraps at both ends, so the control never dead-ends.

Dependencies

motionclsxtailwind-mergelucide-react