Expanding Panels

Expanding Panels

An editorial menu of numbered columns — hover one and it blooms into a full-height accent panel with its content, while the others compress into slim rails with vertical titles.

Installation

▸ Run the following command

npx shadcn@latest add https://www.mellowui.com/r/expanding-panels.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/expanding-panels.tsx
  4. Import and use.

API Reference

PropTypeDefaultDescription
itemsExpandingPanelItem[]Columns — title, optional subtitle, accent, content, cta.
defaultActivenumber | nullnullPanel open on mount; null = all columns rest equal.
heightnumber420Row height in px.
grownumber3.4Flex-grow of the open panel relative to the rails.
stiffnessnumber220Bloom spring stiffness.
dampingnumber30Bloom spring damping.
onActiveChange(index: number | null) => voidCalled when the open panel changes.
onCta(index: number) => voidCalled when a panel CTA is pressed.
classNamestringAdditional CSS classes.