Skip to content
Playground

Collapsible

A single disclosure region controlled by one trigger.

Reveal one optional region without navigating away or managing a collection of sections.

Backed by Base UI Collapsible for upstream behavior and configuration. Zenos follows the same composition model as shadcn/ui Collapsible: an unstyled root, a trigger, and animated content—while keeping the compound Collapsible.Root API.

default

panel

Contained disclosure surface with divider and padding.

Build disclosures from three parts. The root owns open state; it does not impose a card shell unless you opt in.

TSX
<Collapsible.Root>  <Collapsible.Trigger>Toggle details</Collapsible.Trigger>  <Collapsible.Content>Hidden content</Collapsible.Content></Collapsible.Root>
Collapsible.Root├── Collapsible.Trigger└── Collapsible.Content
TSX
import { Collapsible } from "@zentara-co/zenos-ui";

variant="default" (implicit) keeps Root unstyled so you can wrap Card, layout, or custom surfaces—similar to shadcn’s basic and order-detail examples. variant="panel" applies the contained disclosure shell (border, neutral card fill, full-width trigger row, content divider).

The preview above compares both.

A minimal FAQ-style disclosure: inline trigger, chevron, and supporting text below.

Compose a default collapsible inside Card when the trigger should sit in a product surface rather than a standalone panel.

Status

Shipped

Tracking updates when the carrier scans the package.

Use Collapsible.Trigger with Base UI’s render prop when a Button or other control should own the trigger element. Set showChevron={false} when the control already communicates state.

Nested folders and files belong in File Tree. Collapsible stays the primitive for one disclosure region.

Use open and onOpenChange when another part of the UI must read or drive the disclosure. Prefer defaultOpen for local, uncontrolled usage.

Panel is closed.

defaultOpen sets the initial uncontrolled state. A disabled trigger stays visible but cannot open its panel.

When you want the contained shell without wrapping Card, set variant="panel" on Root.

Configure retention, exports, and workspace access policies.

Override surfaces with semantic tokens on Root, Trigger, or contentClassName. Panel variant accepts the same accent treatments as before; default variant keeps animation on Content while you style the surrounding layout.

This campaign includes three audiences and runs until the end of the quarter.

Use Collapsible for one optional region. Use Accordion when several related sections need heading structure and shared list behavior. Use File Tree for nested folders and files.

Variants

defaultpanel
Collapsible.Root
Collapsible.Trigger
Collapsible.Content

API

PropTypeDefaultDescription
Root.variant default | panel default Default leaves Root unstyled for Card and layout composition; panel applies the contained disclosure shell.
open boolean — Controlled expanded state.
defaultOpen boolean false Initial uncontrolled state.
onOpenChange (open: boolean, eventDetails) => void — Runs when state changes.
Trigger.disabled boolean false Prevents Trigger activation.
Trigger.showChevron boolean true Shows the built-in disclosure chevron.
Trigger.render ReactElement | function — Composes Trigger with another element.
Content.contentClassName string — Adds classes to the inner content wrapper without changing panel animation.

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

The trigger is a native button (or the element passed to render) and exposes aria-expanded. Enter and Space toggle it when focused. Keep labels meaningful, preserve visible focus, and avoid nesting interactive controls inside the trigger unless they stop propagation. Motion-reduction preferences disable height and chevron transitions.