Skip to content
Zuno UI
Explore components
EXPLORE
Actions
Forms
Layout
Navigation
Data display
Feedback
Overlays
RESOURCES
Components/Collapsible

Collapsible

Show and hide one region of content, without a parallel styling pattern.

Base UI reference ↗

3 repositories starred

@zuno/ui

Installation

Run it from the root of a project already set up with zunoui init.

npx zunoui@latest add collapsible

Dependencies

What add collapsible installs alongside the component. The CLI skips any you already have in a compatible version.

ZUNO registry

  • @zuno/utils

npm

Examples

2 examples · 1 component
collapsible

3 repositories starred

@zuno/ui

Show more

A Button as the trigger; the text follows the state.

collapsible
Order
#4821
Carrier
DHL Express
Arrives
Oct 2

Order details

Starts open with defaultOpen; closed, the panel stays searchable.

API reference

Keeps the props, events and refs of the matching Base UI primitive, plus ZUNO's styles.

PropTypeDefault
open / defaultOpen

Controlled or uncontrolled state.

booleanfalse
onOpenChange

Called when it opens or closes.

(open: boolean) => void—
disabled

Blocks the trigger.

booleanfalse
CollapsibleTrigger

Unstyled; use render to reuse Button.

button—
CollapsibleContent

Height-animated panel. hiddenUntilFound (default true) keeps it in the DOM and searchable; false unmounts it.

div—

States

The states that apply to this component and their visual treatment.

StateTreatment
ClosedContent unmounted (or hidden until found).
OpenContent expands with a height transition.
DisabledThe trigger does not toggle.

Accessibility

The trigger has aria-expanded and aria-controls pointing to the content; Enter and Space toggle it.

Keep the trigger text describing the content ("Show details" / "Hide details") or pair it with an aria-label; the state is also announced through aria-expanded.

Use Accordion for several related sections; Collapsible is for a single region.

The height animation stops with reduced motion.