One show/hide region with its trigger — advanced settings in a form, "show more" tags, a side-panel block. The single-section primitive under Accordion: no coordination between sections, any element as the trigger, and a height animation that respects reduced motion and data-motion.
Installation
The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";
Usage
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@vamos-ui/react";
<Collapsible>
<CollapsibleTrigger meta="3 fields">Advanced settings</CollapsibleTrigger>
<CollapsibleContent>…</CollapsibleContent>
</Collapsible>WAI-ARIA disclosure: a button with aria-expanded and aria-controls; Enter and Space toggle.
Several sections where only one opens at a time, or arrow-key navigation between headers? Use Accordion.
Examples
Show more (asChild, controlled)
asChild turns any Button into the trigger; control open to change its label. The first items stay outside the region.
Order side panel (CRM)
Independent blocks that can all be open at once. meta summarises a closed block and is part of the button's name; disabled locks one.
- Carrier
- Northline Express
- Tracking
- NLX 4471 0932
- ETA
- Thu, 14 Nov
Motion levels
The region animates its height with ui-collapse. Inside data-motion="off" or with prefers-reduced-motion it opens instantly.
API
Collapsible
| Prop | Type | Default |
|---|---|---|
open / defaultOpen / onOpenChangeControlled or uncontrolled state. | boolean | false |
disabledThe trigger is disabled and the state is locked. | boolean | — |
CollapsibleTrigger
| Prop | Type | Default |
|---|---|---|
asChildUse your own button (Button, a link-styled control). The built-in row look and chevron are skipped. | boolean | — |
iconLeading icon. | ReactNode | — |
metaSummary on the end side ("3 fields", "€1,488.00"). Read as part of the name. | ReactNode | — |
chevronTrailing chevron that turns when open. | boolean | true |
CollapsibleContent
| Prop | Type | Default |
|---|---|---|
forceMountKeep the content in the DOM while closed (for find-in-page or animation libraries). | boolean | — |
classNameGoes on the animated region; put padding on an inner element so the height animation stays smooth. | string | — |