Collapsible
An interactive component that expands and collapses content panels with smooth CSS Grid auto-height transitions and optional lazy content rendering.
import
import { Collapsible } from "@/components/ui/collapsible/collapsible";$
npx @bloomui-react/cli add collapsiblecollapsible.tsx
Default
Standard collapsible panel with a trigger button that reveals hidden items using a smooth height animation.
Lazy Content Rendering
Defers rendering of child components until the panel is expanded for the first time, optimizing initial load performance.
lazy: boolean
Default Open
Pre-expanded collapsible panel using controlled state initialized as open.
open: booleandefaultOpen: boolean
NotificationsEnabled
Two-Factor AuthenticationPending
API AccessRestricted
Card Style
A collapsible section styled as a bordered card container with icon, heading, and description in the trigger.
open: anyisOpen: anyonOpenChange: anysetIsOpen: anyrounded-2xl: anyborder: anyborder-zinc-200: anydark: anyborder-zinc-800: anybg-white: anybg-zinc-900: anyshadow-xs: anyoverflow-hidden: anyasChild: anyw-full: anyflex: anyitems-center: anyjustify-between: anygap-4: anypx-5: anypy-4: anycursor-pointer: anygap-3: anyicon: anyhugeicons: anyshield-01: anytext-sm: anyfont-semibold: anytext-xs: anytext-zinc-500: anyarrow-down-01: anyborder-t: anyspace-y-3: anycolor: anysuccess: any
Disabled State
Disables user interaction with the collapsible trigger, preventing expand or collapse.
disabled: boolean
API Reference
Props — Collapsible & CollapsibleContent
Properties for configuring the Collapsible and CollapsibleContent components.
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | — | Controlled open state of the collapsible panel. |
| defaultOpen | boolean | false | Initial open state when using uncontrolled mode. |
| onOpenChange | (open: boolean) => void | — | Callback function fired when the open state changes. |
| disabled | boolean | false | Disables interaction with the collapsible trigger. |
| lazy | boolean | false | Defers rendering child DOM elements until expanded for the first time. |