Accordion
Reveal sections of related content with keyboard-accessible headings.
Reveal sections of related content with keyboard-accessible headings.
Backed by Base UI Accordion for upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on this page.
default
plain
Anatomy
Section titled “Anatomy”Each item needs a unique value. Wrap the trigger in Header so the disclosure control keeps proper heading semantics.
<Accordion.Root defaultValue={["billing"]}> <Accordion.Item value="billing"> <Accordion.Header> <Accordion.Trigger>Billing</Accordion.Trigger> </Accordion.Header> <Accordion.Content>Invoices and payment methods.</Accordion.Content> </Accordion.Item></Accordion.Root>Root uses the same neutral card surface, border, and radius as Collapsible when variant="default". Trigger matches Collapsible interaction states (hover, open, focus ring, chevron). Content animates height and renders a top divider with padded body text in text-text-subtle.
Variants
Section titled “Variants”variant="default" is the contained card used in settings panels and docs previews. variant="plain" removes the outer border and fill so the accordion sits flush on the page background—only horizontal dividers separate items, triggers have no hover fill, and content flows directly under the title without an inner divider. The preview at the top compares both side by side.
Import
Section titled “Import”import { Accordion } from "@zentara-co/zenos-ui";Single and multiple expansion
Section titled “Single and multiple expansion”By default, opening one item closes the others. Pass multiple when several sections may stay open, such as notification and session settings on the same page.
Control expansion with value and onValueChange, or use defaultValue for uncontrolled usage. Values are string arrays even when only one panel is open.
Disabled item
Section titled “Disabled item”Disable an item when its content is unavailable. The trigger stays visible; Base UI sets aria-disabled and blocks activation.
Accordion or Collapsible
Section titled “Accordion or Collapsible”Use Accordion for a related set of labeled sections where heading structure and choosing among panels matters. Use Collapsible for a single optional region such as advanced settings or secondary metadata.
Styling and composition
Section titled “Styling and composition”Default parts provide the design-system surface, chevron, dividers between items, and content spacing. Use showChevron={false} when another indicator shows state. Apply contentClassName on the inner wrapper so custom styling does not affect the animated panel height.
Pass className on Root or Item to tint the surface and borders. Style Trigger hover and open fills the same way as Collapsible. Trigger supports Base UI’s render prop when a specialized element must own the control—keep a clear accessible name and visible expanded state.
Variants
defaultplain Accordion.Root Accordion.Item Accordion.Header Accordion.Trigger Accordion.Content
API
| Prop | Type | Default | Description |
|---|---|---|---|
Root.variant | default | plain | default | Default uses a bordered card surface; plain is a flat list with horizontal dividers only. |
value | string[] | — | Controlled expanded items. |
defaultValue | string[] | — | Initial uncontrolled expanded items. |
onValueChange | (value: string[]) => void | — | Runs when expansion changes. |
multiple | boolean | false | Allows multiple open items. |
disabled (Item / Trigger) | boolean | false | Disables an item and its trigger. |
Trigger.showChevron | boolean | true | Shows the built-in disclosure chevron. |
Content.contentClassName | string | — | Classes on the inner content wrapper; panel height animation is unchanged. |
Root.className | string | — | Merged on the root. Uses bg-background-neutral-card by default, matching Collapsible. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”Triggers expose button semantics with aria-expanded. Enter and Space toggle the focused section; arrow keys move between triggers in the group. Keep trigger labels concise and unique. Disabled items expose aria-disabled. Motion-reduction preferences disable height and chevron transitions.