accordion
Accordion
Stacked sections the shopper opens and closes, one or several at a time, such as shipping and returns on a product page.
States: Default, Hover, Focus, Disabled
Parts
| Part | File | Does |
|---|---|---|
| Accordion | Accordion.vue | Groups all parts of the accordion. |
| AccordionContent | AccordionContent.vue | Holds what its item shows while open. |
| AccordionItem | AccordionItem.vue | Groups a trigger with the content it opens and closes. |
| AccordionTrigger | AccordionTrigger.vue | Opens and closes the content of its item. |
Anatomy
<Accordion>
<AccordionItem>
<AccordionTrigger />
<AccordionContent />
</AccordionItem>
</Accordion>Styling
| Part | Recipe |
|---|---|
| Accordion | accordion |
| AccordionContent | accordion-body |
| AccordionItem | accordion-item |
| AccordionTrigger | accordion-trigger |
Install
Writes 5 files into components/ui/accordion/. For agents, npx @frontic/ui docs accordion prints this reference as markdown; the MCP server serves the same.
- npm packages
- @lucide/vue
- @vueuse/core
- reka-ui
API reference
Accordion Accordion.vue
Groups all parts of the accordion.
| Prop | Type | Default | |
|---|---|---|---|
| collapsible | boolean | false | |
| disabled | boolean | false | |
| dir | Direction | 'ltr' | |
| orientation | DataOrientation | 'vertical' | |
| unmountOnHide | boolean | true | |
| asChild | boolean | false | |
| as | AsTag | Component | — | |
| type | SingleOrMultipleType | — | |
| modelValue | string | string[] | — | |
| defaultValue | string | string[] | — | |
| class | ClassValue | — | |
| Event | Payload | |
|---|---|---|
| update:modelValue | value: string | string[] | undefined | |
| Slot | Slot props | |
|---|---|---|
| default | { modelValue: AcceptableValue | AcceptableValue[] | undefined; } | |
| Recipe accordion | Sets | |
|---|---|---|
| base: accordion | 3 properties | |
AccordionContent AccordionContent.vue
AccordionItem AccordionItem.vue
AccordionTrigger AccordionTrigger.vue
Example