Spring Accordion

Spring Accordion

An editorial accordion — spring-driven height, answers that rise out of a blur, and an index numeral that ignites on open.

Installation

▸ Run the following command

npx shadcn@latest add https://www.mellowui.com/r/spring-accordion.json

▸ Or install manually

  1. Install dependencies: pnpm add motion
  2. Copy the source from the Code tab above.
  3. Place it at components/mellow/spring-accordion.tsx
  4. Import and use.

API Reference

PropTypeDefaultDescription
items{ title: string; content: ReactNode }[]The accordion rows — a title and the panel content.
multiplebooleanfalseAllow multiple panels open at once.
defaultOpennumber[][]Indices of panels open on mount.
numberedbooleantrueShow the 01 / 02 index column.
classNamestringAdditional CSS classes.