Skip to content
nexubDesign System
v12.7.0

Components · Disclosure

Collapsible

StableAdded v0.0.1

Toggle visibility of content with smooth animation.

import { Collapsible } from '@nexub/react';
View as Markdown

Playground

Props

variant
TSX
<Collapsible.Root open={open} onOpenChange={setOpen}>…</Collapsible.Root>

Examples

Default

Controlled

Advanced settings

States

  • default
  • disabled
  • variant="unstyled"
  • variant="default"

Props

Props
PropTypeDefaultDescription
Collapsible.Root openboolean—Controlled open state.
Collapsible.Root defaultOpenbooleanfalseWhether the collapsible is open by default (uncontrolled).
Collapsible.Root onOpenChange(open: boolean) => void—Callback fired when the open state changes.
Collapsible.Root disabledbooleanfalsePrevents the user from toggling the collapsible.
Collapsible.Trigger asChildbooleanfalseMerges props onto the immediate child element (Radix Slot).
Collapsible.Content forceMountbooleanfalseKeeps the content mounted in the DOM even when closed.
variant'unstyled' | 'default''unstyled'11.5 (Collapsible.Trigger): default is a styled full-width row with a chevron that turns when open.

On iOS & Android