A set of collapsible panels with headings.
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 Base UI. Everything else stays the same.
import { Accordion } from '@animate-ui/react/primitives/base-ui/accordion';
export function FAQ() {
return (
<Accordion.Root defaultValue={['item-1']}>
<Accordion.Item value="item-1">
<Accordion.Header>
<Accordion.Trigger>Is it accessible?</Accordion.Trigger>
</Accordion.Header>
<Accordion.Panel>
Yes. It adheres to the WAI-ARIA design pattern.
</Accordion.Panel>
</Accordion.Item>
</Accordion.Root>
);
}Using the @base-ui/react umbrella import instead? The barrel mirrors it: import { Accordion } from '@animate-ui/react/primitives/base-ui'.
Animation
- Panel 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.
- Motion animates the panel itself: shadcn/ui's
h-(--accordion-panel-height) data-starting-style:h-0 data-ending-style:h-0classes are no longer needed (the CLI removes them).--accordion-panel-heightand--accordion-panel-widthreadauto. keepMountedandhiddenUntilFound, on the Root or a Panel, keep closed panels in the DOM: they collapse, then get Base UI'shidden(orhidden="until-found", which find-in-page can reveal; a panel revealed that way opens at once, as in Base UI).- An
onValueChangethat callseventDetails.cancel()still cancels the change. <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 Base UI's Accordion. Animate UI adds the animation props below.
Root, Item, Header, Trigger
Base UI props only. They are not animated.
Panel
Base UI props, plus:
| Prop | Type | Default |
|---|---|---|
transition? | Transition | { duration: 0.35, ease: [0.215, 0.61, 0.355, 1] } |
exitTransition? | Transition | transition |
A render element (or function) of your own is made animatable with motion.create.