Components · Layout
Accordion
Collapsible panels. Give one items entry per child: child N is the body of item N.
ExamplesLink to this section
Accessible primitives without Radix, with a small API.
Show JSONHide JSON
{
"version": 1,
"root": "accordion",
"elements": {
"accordion": {
"type": "Accordion",
"props": {
"items": [{ "title": "Why Base UI?" }, { "title": "Why Neon?" }],
"openFirst": true
},
"children": ["base-ui", "neon"]
},
"base-ui": {
"type": "Text",
"props": {
"text": "Accessible primitives without Radix, with a small API."
}
},
"neon": {
"type": "Text",
"props": {
"text": "Serverless Postgres with branching and scale to zero."
}
}
}
}PropsLink to this section
Generated from the zod schema the server validates with. Unknown props are ignored with a warning. Any prop can also be a dynamic value such as { "$state": "/path" }; it is checked again once it resolves.
| Prop | Type | Limits and defaults |
|---|---|---|
| itemsrequired | object[] | 1–50 items |
| items[].titlerequired | string | max 160 chars |
| openFirst | boolean | — |
RulesLink to this section
- Give exactly one child per entry in
items: child N is the body of item N. - Do not give an Accordion
repeat: the bodies pair with the items by their place in the spec, so write each body out. An Accordion withrepeatstill draws, with a warning.
ChildrenLink to this section
Accordion shows its children, in order.
It emits no events.