Skip to content
AITroveRead. Build. Understand.
Make this comfortable

HTML details name groups: open one disclosure at a time

Last updated: 5 Oct 20267 min read
tutorial
IntermediateBy AITrove Editorial

Details elements sharing a nonempty name form a group in which at most one disclosure is open.

Use it in a concrete workflow

A short equipment checklist has three mutually exclusive instruction panels. The group keeps only one long procedure visible, saving space on a handheld screen. That choice has a cost: a technician comparing two procedures cannot keep both open. If comparison is common, independent details elements or ordinary headings are better. Use a real summary for each panel and place related disclosures together under one heading.

html
<section>
  <h2>Equipment inspection steps</h2>
  <details name="inspection-steps" open>
    <summary>Check the seal</summary><p>Record the seal code before opening the crate.</p>
  </details>
  <details name="inspection-steps">
    <summary>Measure the package</summary><p>Use the calibrated depot scale.</p>
  </details>
  <details name="inspection-steps">
    <summary>Release the package</summary><p>Confirm the signed inspection note.</p>
  </details>
</section>

Behavior and ownership

Only one member starts open. The browser handles the disclosure state, but it does not complete an inspection, save a checklist, or prevent a technician from skipping a panel.

Performance and maintenance

This is a native interaction with no application bundle. The main cost is task friction when users need simultaneous panels; test the workflow before choosing exclusivity.

Common Mistakes

  • Do not set open on two details in the same name group.
  • Do not use a disclosure as a substitute for required form validation.
  • Do not group panels that users need to compare side by side.

Connected lessons

CSS behavior decisions

Related CSS decisions

html
accessibility
Storage details