Dev Helpers

UI Components / Accordions

Expandable order summary

Dev Helpers · July 20, 2025

An expandable order summary should show the important total even while its line items are collapsed. Expanded rows need readable labels for adjustments.

Worked example

<details open>
  <summary>Order total · $46</summary>
  <dl class="grid">
    <div>
      <dt>Notebook</dt>
      <dd>$40</dd>
    </div>
    <div>
      <dt>Delivery</dt>
      <dd>$6</dd>
    </div>
  </dl>
</details>

Implementation notes

A summary total must include the same adjustments as its expanded details. A stale compact total undermines trust even if the individual rows are correct.

Try it yourself

Add a discount and compare the compact and expanded totals.

Open the UI Components example →

Editorial date July 20, 2025 · Published December 6, 2026

Related articles

Article byline

A byline combines authorship and dates without competing with the headline. Use a machine-readable time value alongside the visible date.

Audio episode transcript card

An episode transcript serves readers who cannot or prefer not to play audio. Identify speakers in text and keep the transcript easy to navigate.

Split editorial hero

A split editorial hero needs a deliberate reading order when columns collapse. Place essential copy where it remains intelligible without the accompanying image.