Accordion
accordionCollapsible sections on the Base UI primitive, with headings a screen reader can list, arrow-key navigation between triggers and a height that animates to the measured content.
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/forme/accordion/accordion";
const faq = [
{
question: "Is Forme a dependency?",
answer:
"No. Every component is copied into your project as source. There is no Forme package at runtime, so there is nothing to upgrade and nothing to break.",
},
{
question: "Can I use it with an existing shadcn project?",
answer:
"Yes. The theme keeps the shadcn token names, and items install through the shadcn CLI from the Forme registry.",
},
{
question: "What does Pro add?",
answer:
"Blocks and templates — dashboards, AI interfaces, auth and billing flows — built from the same free components.",
},
];
export function AccordionDemo() {
return (
<Accordion className="max-w-lg" defaultValue={[faq[0]?.question]}>
{faq.map((item) => (
<AccordionItem key={item.question} value={item.question}>
<AccordionTrigger>{item.question}</AccordionTrigger>
<AccordionContent>{item.answer}</AccordionContent>
</AccordionItem>
))}
</Accordion>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
Usage
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/forme/accordion/accordion";
<Accordion>
<AccordionItem value="refunds">
<AccordionTrigger>Can I get a refund?</AccordionTrigger>
<AccordionContent>Within 14 days, no questions asked.</AccordionContent>
</AccordionItem>
</Accordion>When to use
Reach for it
- Lists of questions or sections where a reader wants one or two, like an FAQ or optional settings.
Use something else
- Content most people need to read — hiding it behind a click only adds work.
- Switching between peers of equal weight; that is
Tabs.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
Parts
AccordionTakes Base UIAccordion.RootAccordionItemTakes Base UIAccordion.ItemAccordionTriggerTakes Base UIAccordion.TriggerAccordionContentTakes Base UIAccordion.Panel
Accessibility
- Each header is an
<h3>holding its button, so a screen reader's heading list doubles as a table of contents.
Motion
- Panels open to the height Base UI measures, and the chevron turns rather than swapping icons.
Related
Forme foundation
Design tokens, motion presets and the shared class-name helper every Forme component builds on.
layout

Card
A bordered surface with a header, title, description, content and footer you compose yourself, so a card is never more structure than the content inside it needs. Everything reads from the foundation tokens, which makes it retheme with the rest of the library.
layout

Separator
A hairline between two things. Horizontal by default and vertical when rotated, with the vertical one stretching to fill the row it sits in so it works between buttons without a height being passed.
layout