Installation
Usage
import AccordionAnimated from "@/components/ruixen/accordion-animated";
const items = [
{
id: "1",
title: "What animations are included?",
content:
"This accordion uses Framer Motion for smooth expand/collapse animations.",
},
{
id: "2",
title: "Is it accessible?",
content:
"Yes, the accordion maintains full keyboard navigation and screen reader support.",
},
];
export default function MyAccordion() {
return <AccordionAnimated items={items} defaultValue="1" />;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | AccordionAnimatedItem[] | - | Array of accordion items |
defaultValue | string | - | ID of the initially open item |
className | string | - | Additional CSS classes |
Features
- Smooth Animations: Uses Framer Motion for fluid expand/collapse transitions
- Icon Animation: Chevron icon rotates smoothly on state change
- Background Transition: Background color animates on open/close
- Accessible: Maintains keyboard navigation and screen reader support

