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).
| Prop | Type | Default | Description |
|---|---|---|---|
type | AccordionTypeAccordionType = 'single' | 'multiple' | 'single' | |
collapsible | boolean | false | single only: allow closing the open item by tapping it again. |
value!! | string[] | undefined | undefined | Controlled open items (use with !!). Leave undefined for uncontrolled. |
defaultValue | string[] | [] |
| Event | Type | Default | Description |
|---|---|---|---|
onValueChange | (value: string[]) => void | () => { } |
Slots: children (trailing closure)
SAccordionItem
One section: border-b last:border-b-0.
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | '' | |
disabled | boolean | false |
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.
| Prop | Type | Default | Description |
|---|---|---|---|
text | ResourceStr | undefined | undefined |
Slots: children (trailing closure)
SAccordionContent
Collapsible body (pt-0 pb-4 text-sm), height-animated.
Slots: children (trailing closure)