AccordionNew
Sections that open in place: the height eases open, the content rises out of a blur a beat later, and opening one folds the other at the same time.
Used forSettingsFiltersOrder and invoice detailsHelp
Install with the shadcn CLI
Templates
Need the whole page?
43 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $99, and 5 are free.
Where it’s used
Settings
Advanced options folded under each group.
Filters
Collapsible filter groups in a sidebar.
Order and invoice details
Line items you can open.
Help
Questions inside an app.
What it handles for you
max-height tricks make closing feel slow and opening stop with a jolt; measured rows don't.
Real height
grid-template-rows 0fr → 1fr, eased 420ms.
Content through a blur
Rises 6px out of a 4px blur, 90ms after the height starts.
Single or multiple
Folding the old one while the new one opens.
Keyboard
↑/↓ between headers, Home/End.
Overview
Accordions often animate a max-height guess, so they lag on close and snap at the end. Here each section opens by grid rows (0fr to 1fr, no guessing), its content rises out of a blur a beat later, and the chevron turns in the same motion. In single mode, opening one folds the other at the same time so the page below barely moves.
States
- open
- Height eases (420ms), content rises from a blur (300ms, 90ms later), chevron turns.
- close
- Content fades fast (160ms) while the height folds.
Usage
Works with
Props
| Prop | Type | Description |
|---|---|---|
| items | AccordionItem[] | value, title, subtitle, content, disabled. |
| type | "single" | "multiple"default "single" | How many can be open. |
| value / defaultValue | string[] | Open sections. |
| onValueChange | (value: string[]) => void | Called on change. |
| variant | "rows" | "cards"default "rows" | Hairline rows or cards. |
Accessibility and motion
- Headers are buttons in h3s with aria-expanded and aria-controls; panels are regions.
- Folded content is inert.
- Reduced motion: sections open in place.
Requirements
React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.
The CLI also installs ui-interaction-motion.
Source
Registry item: /r/accordion.json


