Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
The native HTML disclosure widget for expandable content. Creates an interactive widget that users can open and close without JavaScript.
The <details> element creates a disclosure widget where the contents are visible only when toggled "open." It must contain a <summary> element as its first child, which provides the clickable label.
This is one of the few truly interactive HTML elements that works entirely without JavaScript. In Vanilla Breeze it serves as the foundation for several higher-level components: <accordion-wc>, <tab-set>, and tree navigation all build on native details/summary.
nav.tree)<dialog><drop-down> or <context-menu><accordion-wc>A single details element with a summary label. Use the open attribute to start expanded.
<details> <summary>Click to expand</summary> <p>This content is revealed when the details element is opened.</p></details>
<details open> <summary>Already expanded</summary> <p>This details element starts in the open state.</p></details>
Adjacent <details> elements automatically stack with connected borders — the border-radius is removed between siblings and the top border overlaps to prevent doubling.
<details> <summary>First item</summary> <p>Content for the first panel.</p></details><details> <summary>Second item</summary> <p>Content for the second panel.</p></details><details> <summary>Third item</summary> <p>Content for the third panel.</p></details>
For enhanced keyboard navigation (Arrow Up/Down, Home/End) and ARIA attributes, wrap in <accordion-wc>.
The name attribute groups details elements so only one can be open at a time. This is a native browser feature requiring no JavaScript.
<details name="faq-exclusive" open> <summary>First Question</summary> <p>Only one panel can be open at a time...</p></details><details name="faq-exclusive"> <summary>Second Question</summary> <p>Opening this will automatically close the first panel.</p></details>
Tip: The <accordion-wc> component also supports exclusive mode via data-single, adding keyboard navigation and View Transitions on top.
Details can contain any flow content: lists, definition lists, tables, images, and VB layout primitives.
In Vanilla Breeze, <details> / <summary> is the progressive enhancement base for two major web components. Both use the same HTML structure but add keyboard navigation, ARIA roles, and optional View Transitions.
Wraps details elements with ARIA accordion keyboard navigation (Arrow Up/Down, Home/End) and optional data-single for exclusive mode.
<accordion-wc> <details open> <summary>Section One</summary> <p>Content for the first section.</p> </details> <details> <summary>Section Two</summary> <p>Content for the second section.</p> </details></accordion-wc>
Transforms details elements into a tabbed interface. Summaries become tab buttons in row 1, content panels display in row 2. Uses CSS display: contents on details for grid participation.
<tab-set> <details open> <summary>Tab One</summary> <p>Panel content for the first tab.</p> </details> <details> <summary>Tab Two</summary> <p>Panel content for the second tab.</p> </details></tab-set>
The nav.tree variant uses nested details/summary for collapsible hierarchical menus. The nav context resets details styling and uses a +/− indicator instead of the chevron.
<nav class="tree" aria-label="File browser"> <details open> <summary>Documentation</summary> <details> <summary>Elements</summary> <ul> <li><a href="#">Buttons</a></li> <li><a href="#">Forms</a></li> </ul> </details> <details> <summary>Layout</summary> <ul> <li><a href="#">Grid</a></li> <li><a href="#">Stack</a></li> </ul> </details> </details></nav>
See nav for more tree navigation variants.
details { border: var(--border-width-thin) solid var(--color-border); border-radius: var(--radius-m);} /* Adjacent details connect their borders */details + details { margin-block-start: calc(var(--border-width-thin) * -1); border-start-start-radius: 0; border-start-end-radius: 0;} details:has(+ details) { border-end-start-radius: 0; border-end-end-radius: 0;} /* Content padding */details > :not(summary) { padding-inline: var(--size-m); padding-block-end: var(--size-m);}
Vanilla Breeze uses the ::details-content pseudo-element for smooth height animation. This is progressive — browsers that don't support it simply show/hide instantly.
/* Smooth open/close animation (Chrome 131+, Safari 17.5+) */::details-content { block-size: 0; overflow-y: clip; transition: block-size var(--duration-normal) var(--ease-default), content-visibility var(--duration-normal) allow-discrete;} details[open]::details-content { block-size: auto;}
Several contexts reset or extend the base details styling:
| Context | What Changes |
|---|---|
nav |
Removes border, border-radius, and content padding. Details used for grouping, not disclosure. |
nav.tree |
Replaces chevron with +/− indicator. Adds indentation for nested levels. |
accordion-wc |
Sets display: contents on details. Adds ARIA and keyboard navigation. |
tab-set |
Sets display: contents. Summary becomes tab button in grid row 1. |
@media print |
Forces all details open. Hides chevron markers. |
In print stylesheets, all <details> content is forced visible regardless of the open attribute, so collapsed content is not lost when printing. The chevron indicator is hidden.
/* Print: force all details open, hide markers */@media print { details:not([open]) > *:not(summary) { display: block !important; } summary::after { display: none; }}
| Attribute | Type | Description |
|---|---|---|
open |
boolean | When present, the content is visible. Toggled by user interaction or JavaScript. |
name |
string | Groups details elements. Only one with the same name can be open at a time. |
The <details> element can be controlled programmatically via the open property and the toggle event.
const details = document.querySelector('details'); // Check if openconsole.log(details.open); // true or false // Toggle programmaticallydetails.open = !details.open; // Listen for toggle eventsdetails.addEventListener('toggle', (event) => { console.log('Now', event.target.open ? 'open' : 'closed');});
| Event | Description |
|---|---|
toggle |
Fired when the open state changes. The open property reflects the new state. |
<summary> element receives automatic button-like keyboard behavior<summary> as the first child<summary><accordion-wc> for keyboard arrow navigation between summaries| Key | Action |
|---|---|
| Enter | Toggle open/closed when summary is focused |
| Space | Toggle open/closed when summary is focused |
<summary> — Required clickable child that provides the toggle label<accordion-wc> — Enhanced accordion with Arrow/Home/End keyboard navigation and ARIA<tab-set> — Tab interface built on details/summary with grid layout<nav> — Tree navigation variant uses details for collapsible sections<dialog> — For modal overlays rather than inline disclosureThe <details> element is used across many patterns:
Accordion-style questions and answers
Collapsible navigation sections
Multi-step form disclosure
Expandable checkout sections
Collapsible application panels
Expandable event details
The <details> element is supported in all modern browsers. The name attribute for exclusive accordions is supported in Chrome 120+, Safari 17.2+, and Firefox 130+. The ::details-content animation pseudo-element works in Chrome 131+ and Safari 17.5+; other browsers fall back to instant show/hide.