Disclosure
Native details and summary with stable styling hooks. CSS only
<section aria-label="Disclosure examples"> <details class="ui-disclosure" open> <summary>Why details and summary?</summary> <div> <p>Native disclosure keeps keyboard interaction and semantics in the platform while Timeless styles the public anatomy.</p> </div> </details> <details class="ui-disclosure"> <summary>Can consumers customize the content?</summary> <div> <p>Yes. The panel is author-owned Light DOM, so app CSS can target it without crossing a shadow boundary.</p> </div> </details></section>Install
import '@timelessui/components/css/tokens.css'import '@timelessui/components/css/disclosure.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-disclosure. Required stylesheets: tokens.css, disclosure.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 Disclosure in StoryLite for variants, controls, and manual testing.