The <details> Element
Technical Summary
The details element represents a disclosure widget from which a user can obtain additional information or controls. Its first summary element child represents the summary or legend; the remaining contents represent the additional information or controls.
open is a boolean content attribute for the visibility state. Non-empty equal name values group details elements in the same tree into an exclusive group managed by the user agent. This element does not represent tab or menu widgets.
Definition / Categories
| Item | Specification summary |
|---|---|
| Meaning | A disclosure widget for additional information or controls |
| Categories | Flow content, Interactive content, Palpable content |
| Context | Where flow content is expected |
| Content model | One summary element followed by flow content |
| Content attributes | Global attributes, name, and open |
| DOM interface | HTMLDetailsElement, including the open IDL attribute |
Disclosure and summary selection
The first summary element child is the summary for the details element. If there is no summary child, the user agent may provide its own legend, such as “Details”. The rest of the element's contents represent the additional information or controls.
<details>
<summary>Check the implementation conditions</summary>
<p>This is the additional information or control area.</p>
</details>
The summary content model is phrasing content, optionally intermixed with heading content. For a useful closed-state label, keep the text specific enough to predict what will be revealed.
Native disclosure example
This example uses no page-side JavaScript for the basic open and close behavior. The user agent manages the open state and disclosure UI.
open state and activation
open is a boolean content attribute. When present, the summary and additional contents are shown; when absent, only the summary is shown. Activating the summary causes the user agent to set or remove the parent details element's open attribute.
const details = document.querySelector('details');
details.open; // Boolean reflection of the open attribute
details.toggleAttribute('open');
details.addEventListener('toggle', (event) => {
console.log(event.oldState, event.newState);
});
Changes to open queue a toggle event. When the state changes repeatedly in quick succession, the notification task is coalesced, so an event is not necessarily fired for every intermediate state. Attribute changes, current rendering, and event timing should be analyzed separately.
Exclusive groups with name
Details elements in the same tree with the same non-empty name value belong to the same details name group. Opening one removes the open attribute from another open member. Initial markup must not contain more than one open member of the same group.
SPEC
This section describes the normative claims to check.
IMPL
This section describes observations reproduced in a browser.
If the purpose is to compare multiple sections at once, an exclusive group may be the wrong information design. The convenience of an accordion should be weighed against the cost of repeatedly reopening content.
Content model and usage boundary
| Structure | What to verify |
|---|---|
First summary | Acts as the summary or legend for the disclosure |
| Flow content after summary | Additional information or controls revealed when open |
No open | Only the summary is shown; the disclosure is closed |
Equal name | Same-tree, non-empty values form an exclusive group |
details is for disclosure widgets. Do not replace tab widgets, menu widgets, footnotes, or dialogs with details merely because their visual presentation might look similar.
DOM Interface
HTMLDetailsElement.open reflects the presence of the open attribute as a boolean. When reading the specification state, separate the boolean state from the attribute's string value.
const details = document.querySelector('#settings');
const summary = details.querySelector(':scope > summary');
details.open;
details.hasAttribute('open');
summary.textContent;
Fact / Evidence
Normative claims about the element, summary selection, state changes, and exclusive groups are separated from browser and accessibility observations in the Implementation Evidence section below.
| Type | Fact / claim | Condition / scope | Status | Source |
|---|---|---|---|---|
| SPEC | details represents a disclosure widget, and its first summary element child is its summary or legend. | Meaning, context, content model, and summary selection. | Reviewed | HTML Standard: details element |
| SPEC | open is a boolean attribute that represents the visibility state of the summary and additional contents. | Attribute presence, summary activation, initial and current state. | Reviewed | HTML Standard: open state |
| SPEC | Changes to open queue a toggle event, and repeated changes may be coalesced into one notification. | Details notification task, ToggleEvent, oldState, and newState. | Reviewed | HTML Standard: details notification task |
| SPEC | Details elements in the same tree with equal non-empty name values form a group with at most one open member. | Group membership, open-attribute exclusivity, and initial markup. | Reviewed | HTML Standard: details name group |
| SPEC | A summary is the summary for its parent details when it is the first summary element child. | First-child relation, summary selection, and activation behavior. | Reviewed | HTML Standard: summary element |
Evidence
- HTML Standard: The details element — meaning, categories, content model, open, name groups, toggle notification, and DOM interface
- HTML Standard: The summary element — summary selection, content model, and activation behavior
- HTML Accessibility API Mappings — entry point for roles, names, and expanded-state mappings
- Web Platform Tests: the-details-element — related tests for details, summary, open, and exclusive name groups
Implementation Evidence
Browser implementation, WPT, and accessibility observations are recorded separately from normative claims. No dedicated fixture has been executed for this new topic, so unverified items are not marked as reviewed.
Dedicated fixture: details-v1 is a proposed identifier for a follow-up fixture covering initial open, summary activation, IDL state, toggle, and exclusivity within a shared name group. The fixture file and execution results are not registered yet.
| Type | Reproduction scope | Conditions to record | Status |
|---|---|---|---|
| IMPL | Summary activation, open IDL reflection, toggle event, and name-group exclusivity | Record browser and OS, date, fixture ID details-v1, initial markup, and dynamic changes across Chrome, Firefox, and Safari | Not run |
| WPT | Individual tests for details, summary, open, toggle, and exclusive details name groups | Run selected files under the-details-element; record browser, date, pass/fail, and unrun reasons | Not run |
| AAM | Summary role and accessible name, details expanded state, and the tree after toggling | Observe closed/open states in browser accessibility trees, compare with HTML-AAM, and where possible include assistive-technology observations | Not run |
Native disclosure indicators, keyboard interaction, rendering, and accessibility-tree exposure may depend on the user agent, OS, and state. A single-environment observation will not be registered as universal browser behavior.
Coverage / Open Issues
- CoveredMeaning, categories, context, content model, content attributes, and DOM interface
- CoveredSummary selection, boolean open state, toggle notification, and the exclusive name-group model
- OpenCross-browser comparison of summary activation, open reflection, toggle events, and name groups
- OpenDisclosure-marker rendering, closed-content rendering, dynamic insertion/movement, and repeated toggles
- OpenIndividual WPT results, HTML-AAM mappings, accessibility-tree observations, and assistive-technology differences
This is initial coverage. It records the normative scope without claiming identical disclosure UI, event timing, accessibility API results across browsers, or completion of the entire details element review.
Related surface
For a beginner-friendly explanation of disclosure sections, summary, open, and name, see the details element page in Yugien. For the semantic and interaction boundary with dialogs, see the dialog element. For command activation, see the button element; for the scripting boundary, see the script element.