Native Solid 2 fork. Original documentation and designs © WorkOS; historical posts retain their original context.
Collapsible
An interactive component which expands/collapses a panel.
@peduarte starred 3 repositories
@radix-ui/primitives
Features
Full keyboard navigation.
Can be controlled or uncontrolled.
Anatomy
Import the components and piece the parts together.
API Reference
Root
Contains all the parts of a collapsible.
Trigger
The button that toggles the collapsible.
Content
The component that contains the collapsible content.
Examples
Animating content size
Use the --radix-collapsible-content-width and/or --radix-collapsible-content-height CSS variables to animate the size of the content when it opens/closes. Here's a demo:
Accessibility
Adheres to the Disclosure WAI-ARIA design pattern.