Skip to content

<details> and <summary> elements #553

@dbaron

Description

@dbaron

Description

The details and summary elements are existing HTML elements that represent a disclosure widget. However, they are not that widely used on the web because many cases of web content that wants to use such widgets wants capabilities that they don't provide.

There are a few areas of work here, at different stages of completeness:

Exclusive accordion (Explainer, HTML Spec PR (merged)) adds a name attribute to the details elements to allow grouping multiple details elements into an exclusive accordion in which at most one of them is open.

Improvements to stylability of the details and summary elements: Ability to style these elements is a major obstacle for use on the web. I have a rather out of date explainer for work I hope to pursue in this space, and I've started prototyping it. It would need significant iteration on the prototype, progress on the proposal, tests, and specification adoption before the start of 2024 in order to be included in Interop 2024.

There are also some existing accessibility issues with details and summary, some of which relate to lack of interoperability, that are also worth making progress on. The status here is similar to that of styling, or perhaps even a bit murkier.

Specification

https://html.spec.whatwg.org/multipage/C#the-details-element

Open Issues

see description above

Tests

Exclusive accordion:
https://wpt.fyi/results/html/semantics/interactive-elements/the-details-element/name-attribute.html

Details styling (these are very tentative, especially the pseudo-elements ones):
https://wpt.fyi/results/html/rendering/the-details-element/details-display-type-001.tentative.html
https://wpt.fyi/results/html/rendering/the-details-element/details-pseudo-elements-001.tentative.html
https://wpt.fyi/results/html/rendering/the-details-element/details-pseudo-elements-002.tentative.html

Current Implementations

  • Blink
  • Gecko
  • WebKit

Standards Positions

Exclusive accordion:

Browser bug reports

Exclusive accordion:

Details styling:

Developer discussions

No response

Polls & Surveys

No response

Existing Usage

Some examples of things that could be exclusive accordions are in the explainer.

Workarounds

No response

Accessibility Impact

Improved accessibility is one of the underlying goals here, since if developers use platform widgets they're likely to be more accessible and have more consistent behavior across sites than what the developers would build on their own.

Privacy Impact

No response

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions