Accordion
Spring Accordion
An accordion whose panels open on a spring while the plus icon folds into a minus.
npx motionsnack add spring-accordionCustomize
<SpringAccordion />Props
17 properties
| Property | Type | Default | Description |
|---|---|---|---|
| items | { value: string; label: string; content: ReactNode; disabled?: boolean }[] | 4 demo questions | Items of the accordion. An empty array renders nothing. |
| value | string[] | - | Values of the open items. With a value the component is controlled. |
| defaultValue | string[] | ['licence'] | Values open at the start when uncontrolled. |
| onChange | (value: string[]) => void | - | Called with the values of the open items after a user toggle. |
| mode | 'single' | 'multiple' | - | Deprecated alias of multiple. |
| separated | boolean | - | Deprecated alias of variant='separated'. |
| showIcon | boolean | true | Deprecated: false hides the indicator. |
| accent | string | - | Deprecated, ignored: the open tile is the monochrome on fill. |
| duration | number | - | Deprecated, ignored: panels expand in 300ms. |
| bounce | number | - | Deprecated, ignored. |
| className | string | '' | Extra classes on the root. |
| multiple | boolean | false | Let any number of items stay open; otherwise one at a time. |
| collapsible | boolean | true | With one item open at a time, let the open one close. |
| variant | 'card' | 'separated' | 'flush' | 'card' | One card with dividers, a card per item, or dividers only. |
| indicator | 'plus' | 'chevron' | 'plus' | End-of-row indicator. |
| headingLevel | '2' | '3' | '4' | '5' | '6' | '3' | Heading level of each trigger's heading element. |
| radius | '16' | '12' | '16' | Corner radius of the frame. |
About Spring Accordion
Spring Accordion is a list of questions in a single glass card, or as separate cards with a gap between them. Clicking a row opens its panel with a spring on the height, so the answer settles with a small, tunable bounce instead of a linear slide, and the text eases into place as it appears. The plus icon turns half a circle and its vertical bar folds flat into a minus, while the badge fills with the accent colour on the open row. It works in single mode, where opening one row closes the other, or in multiple mode, and it can be controlled or left to manage its own state. Headers are real buttons with arrow, Home and End key navigation, and reduced-motion users get an instant change.
What's included
- Spring height animation with adjustable duration and bounce
- Plus icon that morphs into a minus
- Single or multiple open mode, optional collapse
- One card with dividers or separated cards
- Controlled and uncontrolled state (value, defaultValue, onChange)
- Arrow, Home and End keys, aria-expanded and labelled regions
- Light and dark look, accent colour prop
- Type
- Animated React accordion component
- Library
- Components · Accordion
- Stack
- Next.js, React, Tailwind CSS
- Added
- 2026-09-20