Collapsible
Style native disclosure groups without replacing details. CSS only
<div> <details class="ui-collapsible" open> <summary>What ships?</summary> <div> <p>CSS, explicit element definitions, and public types.</p> </div> </details></div>Install
import '@timelessui/components/css/tokens.css'import '@timelessui/components/css/collapsible.css'Attributes
Every value below is implemented by the stylesheets this component ships. Boolean attributes are presence-based: author the attribute with no value, or omit it.
| Attribute | Values | Default | Description |
|---|---|---|---|
data-ui-density | compact · normal | normal | Summary and content padding. |
Styling
Root identity: ui-collapsible. Required stylesheets: tokens.css, collapsible.css.
This component adds no custom properties of its own. Restyle it through the design tokens or your own CSS.
Design tokens this component reads (10)
These are global Atmosphere tokens. Change them once at the theme level rather than per component.
--ui-accent · --ui-duration-fast · --ui-ease-standard · --ui-fg · --ui-fg-muted · --ui-focus · --ui-line · --ui-space-3 · --ui-space-4 · --ui-space-5
Accessibility
Keep the native elements, roles, and relationships shown in the example. Timeless adds only the state and keyboard coordination the platform does not already provide, and it never supplies your accessible names — those depend on your content.
Before JavaScript runs
This primitive is CSS only. There is nothing to register and nothing to wait for.
More examples
Open Collapsible in StoryLite for variants, controls, and manual testing.