Skip to content

Accordion ​

A vertically stacked set of interactive headings that each reveal a section of content.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Multiple & controlled ​

type: 'multiple' keeps several items open. Bind the open items with !!.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SAccordion ​

shadcn-vue Accordion: a vertically stacked set of interactive headings that each reveal a section of content.

value is always a string array (also for type: 'single', where it holds at most one entry).

PropTypeDefaultDescription
typeAccordionType
AccordionType = 'single' | 'multiple'
'single'
collapsiblebooleanfalsesingle only: allow closing the open item by tapping it again.
value!!string[] | undefinedundefinedControlled open items (use with !!). Leave undefined for uncontrolled.
defaultValuestring[][]
EventTypeDefaultDescription
onValueChange(value: string[]) => void() => { }

Slots: children (trailing closure)

SAccordionItem ​

One section: border-b last:border-b-0.

PropTypeDefaultDescription
valuestring''
disabledbooleanfalse

Slots: children (trailing closure)

SAccordionTrigger ​

The heading row: flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-sm font-medium hover:underline, with a chevron that turns 180° while open. Tapping toggles the item.

PropTypeDefaultDescription
textResourceStr | undefinedundefined

Slots: children (trailing closure)

SAccordionContent ​

Collapsible body (pt-0 pb-4 text-sm), height-animated.

Slots: children (trailing closure)

MIT Licensed