A vertically stacked set of interactive headings that each reveal an associated section of content.
We offer standard (5-7 days), express (2-3 days), and overnight shipping. Free shipping on international orders.
Installation
Install the packages
Add the shadcn/ui component
Animate it
The CLI finds your shadcn/ui components through components.json, swaps their primitive imports for Animate UI's and removes the CSS animation classes Motion replaces.
Usage
Import the primitive from Animate UI instead of Radix UI. Everything else stays the same.
import { Accordion } from '@animate-ui/react/primitives/radix-ui';
export function FAQ() {
return (
<Accordion.Root type="single" collapsible>
<Accordion.Item value="item-1">
<Accordion.Header>
<Accordion.Trigger>Is it accessible?</Accordion.Trigger>
</Accordion.Header>
<Accordion.Content>
Yes. It adheres to the WAI-ARIA design pattern.
</Accordion.Content>
</Accordion.Item>
</Accordion.Root>
);
}Coming from the @radix-ui/react-accordion package? Use the subpath: import * as AccordionPrimitive from '@animate-ui/react/primitives/radix-ui/accordion'.
Animation
- Content unfolds: its height grows from 0 while the content fades in from a 2px blur, over 350ms on a soft ease-out. While it moves, its bottom edge fades (over 16px, or over the part still hidden): the content never meets what follows it, an item's border, with a hard cut. It folds back the same way, in reverse, then unmounts.
- Opening another item while one is closing retargets smoothly.
- An item open by default animates open on mount (page load), as in v1.
- With
forceMount, closed content stays in the DOM, collapsed andinert. <AnimateUIProvider tempo>paces both transitions.- Under reduced motion, the height changes at once; the fade and the blur still play.
API Reference
Every part takes exactly the props of Radix UI's Accordion. Animate UI adds the animation props below.
Root, Item, Header, Trigger
Radix UI props only. They are not animated.
Content
Radix UI props, plus:
| Prop | Type | Default |
|---|---|---|
transition? | Transition | { duration: 0.35, ease: [0.215, 0.61, 0.355, 1] } |
exitTransition? | Transition | transition |