import { Accordion } from '@/components/sora-ui/disclosure/accordion';const items = [ { title: 'What is Sora UI?', content: 'Sora UI is an animated component registry for React and Next.js, built on Motion.', defaultOpen: true, }, { title: 'How do I install a component?', content: 'Run npx shadcn@latest add @soralabs/accordion after initializing shadcn/ui.', },];export default function Page() { return <Accordion items={items} />;}
For custom content per item, pass a React node as content or compose with the compound API:
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger,} from '@/components/sora-ui/disclosure/accordion';export default function Page() { return ( <Accordion> <AccordionItem defaultOpen> <AccordionTrigger>Custom layout</AccordionTrigger> <AccordionContent> <div className="pb-5 text-sm">Your own markup here.</div> </AccordionContent> </AccordionItem> </Accordion> );}
Use the Accordion for FAQ sections, settings panels, or any content group where users need to scan multiple topics quickly and expand only the ones they care about. It works well when you have 4–12 items of similar importance and collapsing them reduces cognitive load — for example, product feature breakdowns, pricing tier details, or support documentation.
Avoid it when all items need to be visible at once, or when there are fewer than 3 items (a simple list or card layout is clearer).
AccordionTrigger renders as a native <button>, so keyboard navigation (Tab, Enter, Space) works without extra configuration. Each panel region gets an aria-expanded attribute and is linked to its trigger via aria-controls. When prefers-reduced-motion: reduce is active, expand and collapse animations are skipped while the items remain fully interactive.
Sora UI is an animated component registry for React and Next.js. It ships copy-paste primitives built on Motion and GSAP, with live docs, demos, and a shadcn-compatible install flow so you can add polished UI effects directly into your project.
Initialize shadcn/ui in your app, then run the add command with the Sora UI registry scope—for example, npx shadcn@latest add @soralabs/accordion. The CLI copies the source into your project so you own and can customize every file.
Yes. Components are added as source files in your codebase, not as an opaque npm package. Tweak Tailwind classes, variants, and tokens to match your design system. Primitives also expose CVA variant helpers you can extend.
Most primitives use Motion (motion/react)—timelines, springs, and layout animations composed with Motion APIs. Scroll-driven text like Text Reveal Block uses GSAP SplitText and ScrollTrigger. Wrap your app in MotionConfig with reducedMotion set to user for accessible defaults.
Accordion
An animated FAQ accordion with expandable panels, powered by Motion. A React component for shadcn/ui.
Sora UI is an animated component registry for React and Next.js. It ships copy-paste primitives built on Motion and GSAP, with live docs, demos, and a shadcn-compatible install flow so you can add polished UI effects directly into your project.
Initialize shadcn/ui in your app, then run the add command with the Sora UI registry scope—for example, npx shadcn@latest add @soralabs/accordion. The CLI copies the source into your project so you own and can customize every file.
Yes. Components are added as source files in your codebase, not as an opaque npm package. Tweak Tailwind classes, variants, and tokens to match your design system. Primitives also expose CVA variant helpers you can extend.
Most primitives use Motion (motion/react)—timelines, springs, and layout animations composed with Motion APIs. Scroll-driven text like Text Reveal Block uses GSAP SplitText and ScrollTrigger. Wrap your app in MotionConfig with reducedMotion set to user for accessible defaults.
import { Accordion } from '@/components/sora-ui/disclosure/accordion';const items = [ { title: 'What is Sora UI?', content: 'Sora UI is an animated component registry for React and Next.js, built on Motion.', defaultOpen: true, }, { title: 'How do I install a component?', content: 'Run npx shadcn@latest add @soralabs/accordion after initializing shadcn/ui.', },];export default function Page() { return <Accordion
For custom content per item, pass a React node as content or compose with the compound API:
Use the Accordion for FAQ sections, settings panels, or any content group where users need to scan multiple topics quickly and expand only the ones they care about. It works well when you have 4–12 items of similar importance and collapsing them reduces cognitive load — for example, product feature breakdowns, pricing tier details, or support documentation.
Avoid it when all items need to be visible at once, or when there are fewer than 3 items (a simple list or card layout is clearer).
AccordionTrigger renders as a native <button>, so keyboard navigation (Tab, Enter, Space) works without extra configuration. Each panel region gets an aria-expanded attribute and is linked to its trigger via aria-controls. When prefers-reduced-motion: reduce is active, expand and collapse animations are skipped while the items remain fully interactive.