NK

Search

Search pages, projects, posts, components, and icons

All components

Accordion Motion

Layout

An accordion that animates panel height and chevron.

Every component, with source.

Installation

Add it with the shadcn CLI:

$pnpm dlx shadcn@latest add https://nawalkattel.com.np/r/accordion-motion.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/accordion-motion.tsx

Props

PropTypeDefaultDescription
items{ title: string; content: string }[] - Panels to render.

Accessibility

  • Real buttons drive each panel, so keyboard toggling works.
  • Height animates from 0 to auto without clipping content.
  • Chevron rotation reinforces the open state visually.

Dependencies

motionclsxtailwind-mergelucide-react