The <summary> element is the visible label for a <details> disclosure widget. Activating it toggles the parent open or closed.
Put <summary> as the first child of <details>. Its text is the accessible description for the widget. Start expanded with open on <details>, not on <summary>.
Baseline · Widely available.
Core <details> / <summary> has been widely available since about January 2020. Some styling hooks vary by browser.
Warning: headings inside summary.
Some browsers expose summary like a button and strip roles from children. Prefer plain text or <strong>; test if you nest headings.
Non-standard: ::-webkit-details-marker.
Safari-oriented marker styling. Prefer standard ::marker where possible, and test both.
Keep the label short so it scans well when closed.
Wrap key words in <strong> if needed.
Avoid relying on headings inside summary for outline structure.
Test with a screen reader if the label is complex.
Example 4 — Simple FAQ List
Stack several details / summary pairs for a lightweight FAQ.
HTML
<details>
<summary>Do I need an account?</summary>
<p>No. Guests can check out.</p>
</details>
<details>
<summary>How long is shipping?</summary>
<p>Usually 3–5 business days.</p>
</details>
Each widget toggles alone unless you group with name on details.
Write natural questions — the summary is what users always see.
Edge Cases & Pitfalls
Most summary bugs come from wrong placement or treating it like a free-standing heading.
parent
Must be first child of details
Do not put <summary> alone on the page or after other content inside details.
omit
Missing summary = default label
Without summary, browsers often show “Details”. Always write a real label.
a11y
Be careful with nested headings
Heading roles inside summary can be lost in some browsers. Prefer text or strong when in doubt.
open
open is on details
There is no open attribute on summary. Presence of open on details means expanded.
marker
Triangle styling varies
Default display: list-item enables a disclosure marker. Customize with ::marker; WebKit may need extra care.
Compatibility
Browser Support
The <summary> element is core HTML used with <details>. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<summary>
Widely available with details since about January 2020. Chrome, Firefox, Safari, Edge, and Opera support the basic disclosure pattern.
96%Global support (approx.)
Google ChromeAll modern
Full support
Mozilla FirefoxAll modern
Full support
Apple SafariAll modern
Full support
Microsoft EdgeAll modern
Full support
OperaAll modern
Full support
Samsung InternetAll modern
Full support
Internet Explorer—
Not supported
<summary>Widely supported
Bottom line: Safe for modern browsers as a details label. Always provide a clear summary text, and test accessibility if you nest complex markup.
Remember
Key Takeaways
Role:<summary> is the clickable label for <details>.
Placement: first child of details — nowhere else.
State: use open on details to start expanded.
No JS needed: the browser toggles when the summary is activated.
One line: write a clear <summary> as the first child of <details>.
UA style
Default CSS Settings
Typical user-agent styling (enables the disclosure marker):
default.css
summary {
display: list-item;
}
Set list-style: none or change ::marker to customize (or hide) the triangle. Behavior can differ slightly across browsers.
Frequently Asked Questions
The summary element is the visible label for a details disclosure widget. Clicking it opens or closes the parent details.
Only as the first child of a details element. Outside details, summary is invalid for this purpose.
No. summary only supports the global attributes. The open state lives on the parent details element.
Browsers often show a default label such as "Details". Always provide a clear summary for users and accessibility.
Yes technically, but some browsers treat summary like a button and strip heading roles from children. Prefer plain text or strong, and test with assistive tech.
No for basic open/close. The browser toggles details when summary is activated. Listen for toggle on details only if you need scripting.