◇
Accordion
4 partsAnatomy
Import the parts and compose them. Each part forwards attributes to its underlying element.
vue
import {
AccordionRoot,
AccordionItem,
AccordionTrigger,
AccordionContent,
} from '@robonen/primitives/accordion';
<AccordionRoot>
<AccordionItem />
<AccordionTrigger />
<AccordionContent />
</AccordionRoot>API Reference
AccordionRoot
Root| Prop | Type | Description |
|---|---|---|
modelValue? | string | string[] | Current open value(s) for controlled mode. |
defaultValue? | string | string[] | Initial value(s) for uncontrolled mode. |
type? | 'single' | 'multiple' | 'single' allows one panel; 'multiple' allows many. |
collapsible? | boolean | Allow closing all panels in single mode. |
disabled? | boolean | Disable all items. |
orientation? | 'horizontal' | 'vertical' | Orientation of the accordion. |
dir? | RovingDirection | Writing direction. |
loop? | boolean | Wrap keyboard navigation. |
Emits
| Event | Payload |
|---|---|
update:modelValue | [value: string | string[] | undefined] |
AccordionItem
Item| Prop | Type | Description |
|---|---|---|
value | string | Unique value for this item. |
disabled? | boolean | Disable this item. |
AccordionTrigger
TriggerNo props or events — renders its element and forwards attributes.
AccordionContent
Content| Prop | Type | Description |
|---|---|---|
forceMount? | boolean | Keep content mounted even when closed. |