Skip to content

Layout

Collapsible

Expand/collapse disclosure panel.

import { Collapsible } from '@var-ui/react';

Collapsible

Expand/collapse panel built on React Aria Disclosure. Use Accordion for stacked multi-panel layouts, or CollapsibleGroup for a lower-level grouping API.

  • headingLevel={false} renders the trigger button without the wrapping heading — useful for long lists of collapsible rows that shouldn’t pollute the document outline.
  • trigger replaces the default title + chevron. Pass icon alongside it to render the rotating chevron (or any node) next to the custom content; icon={null} hides the default chevron on title triggers. The Astro component mirrors this with a named icon slot and a hideIcon prop.

Examples

Default

Demo.tsxTSX
import { Collapsible, CollapsibleGroup } from '@var-ui/react';

<CollapsibleGroup>
  <Collapsible id="a" title="Section A" variant="bordered">…</Collapsible>
  <Collapsible id="b" title="Section B" variant="bordered">…</Collapsible>
</CollapsibleGroup>

Props

Accessibility

The trigger is a button with aria-expanded; the panel is associated automatically.