A component that expands or collapses to show or hide content.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus odit
optio, eaque laborum nesciunt dolores temporibus accusantium neque quasi
dolore, id itaque architecto libero voluptatem laboriosam soluta nobis
consectetur earum?
Usage
<script> import {Collapsible} from 'ui-ingredients';</script><Collapsible.Root> <Collapsible.Trigger>Toggle</Collapsible.Trigger> <Collapsible.Content>Content</Collapsible.Content></Collapsible.Root>
API Reference
Root
Prop
Default
Description
defaultOpen
booleanThe initial open state of the collapsible when rendered.
Use when you don't need to control the open state of the collapsible.
disabled
booleanWhether the collapsible is disabled.
id
stringThe unique identifier of the machine.
ids
{
root?: string;
content?: string;
trigger?: string;
}The ids of the elements in the collapsible. Useful for composition.
onExitComplete
VoidFunctionThe callback invoked when the exit animation completes.
onOpenChange
(details: OpenChangeDetails) => voidThe callback invoked when the open state changes.
open
booleanThe controlled open state of the collapsible.