Skip to main content

  • Foundations
    • Border radius
    • Breakpoints
    • Colours
    • Colour scheme
    • Elevation
    • Focus and outline
    • Sizing and spacing
    • Layout
    • Motion
    • Typography
    • Z-index
  • Elements
    • Buttons
    • Code
    • Icons
    • Figure and caption
    • Forms
    • Links
    • Lists
    • Media
    • Tables
  • Components
    • Accordion
    • Alerts
    • Avatar
    • Blockquote
    • Breadcrumbs
    • Card
    • Chiplets
    • Details and summary
    • Dialog
    • Empty state
    • Stats
    • Global footer
    • Horizontal rule
    • Kanban
    • Key-value list
    • Meter
    • Objects
    • Pagination
    • Polka background
    • Post-it note
    • Progress
    • Speech bubbles
    • Status dot
    • Skeleton
    • Skip link
    • Spinner
    • Toggles
    • Tooltip
    • Webmentions
  • Patterns
    • Article header
    • Author card
    • App list and app sheet
    • Error page
    • Related posts
    • Search results
    • Utilities

John Peart

  • Search
  • Menu
John Peart

Details and summary

Expandable disclosure widget.

A native disclosure widget. The <summary> is the always-visible trigger; the remaining children are revealed when open. Styling swaps the default triangle for a ↓/↑ marker.

Basic

Click to expand

The quick brown fox jumps over the lazy dog.

<details>
  <summary>Click to expand</summary>
  <p>The quick brown fox jumps over the lazy dog.</p>
</details>

Inside a key-value item

Used on the About page to let each career role expand into a longer description. The <summary> holds the key-value row; the revealed content adds sub-headings and project links.

  • Chief Executive

    Office for Digital Identities and Attributes

    September 2025 to present

    About this role

    Accountable for the overall delivery of the digital verification services measures in Part 2 of the Data (Use and Access) Act 2025.

<li class="key-value--item key-value--with-detailssummary …">
  <details>
    <summary>
      <h3 class="key-value--key">Role title</h3>
      <div class="key-value--description">
        <p>Organisation</p>
      </div>
      <p class="key-value--value small-text secondary-text">Dates</p>
    </summary>
    <h4>About this role</h4>
    <p>Longer description revealed on open.</p>
  </details>
</li>

Collapsible navigation

Used in the sidebar on these boilerplate pages. A <details> groups a section of navigation under a clickable <summary>; the open attribute keeps the current section expanded by default.

  • Foundations
    • Colours
    • Typography
    • Spacing
  • Components
    • Accordion
    • Details and summary
<nav aria-label="Example navigation">
  <ul>
    <li>
      <details open>
        <summary><a href="/section/">Section</a></summary>
        <ul>
          <li><a href="/section/page/" aria-current="page">Current page</a></li>
          <li><a href="/section/other/">Other page</a></li>
        </ul>
      </details>
    </li>
  </ul>
</nav>

See also

Accordion — grouping multiple <details> together, including the name attribute for mutually exclusive panels.

A line drawing of John Peart

John Peart

www.johnpe.art

Mastodon logo

Mastodon

BlueSky logo

Bluesky

LinkedIn logo

LinkedIn

Github logo

GitHub