Build faster with Premium Chakra UI Components 💎

Learn more
Skip to Content
DocsPlaygroundGuidesBlog
Sponsor

Collapsible

Used to expand and collapse additional content.

SourceStorybookRecipeArk

Usage

import { Collapsible } from "@chakra-ui/react"
<Collapsible.Root>
  <Collapsible.Trigger />
  <Collapsible.Content />
</Collapsible.Root>

Examples

Lazy Mounted

Use the unmountOnExit prop to make the content unmount when collapsed.

Props

Root

PropDefaultType
lazyMount false
boolean

Whether to enable lazy mounting

unmountOnExit false
boolean

Whether to unmount on exit.

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.
defaultOpen
boolean

The initial open state of the collapsible when it is first rendered. Use when you do not need to control its open state.

disabled
boolean

Whether the collapsible is disabled

ids
Partial<{ root: string; content: string; trigger: string }>

The ids of the elements in the collapsible. Useful for composition.

onExitComplete
() => void

Function called when the animation ends in the closed state.

onOpenChange
(details: OpenChangeDetails) => void

Function called when the popup is opened

open
boolean

Whether the collapsible is open

Previous

Close Button

Next

Color Picker