Skip to content

Summary list

Labels and values in a description list, each row with an optional Change link.

<dl class="cap-summary-list" id="sl-check">
  <div>
    <dt>Site name</dt>
    <dd>Field notes</dd>
    <dd class="cap-summary-actions"><a href="#name">Change<span class="cap-sr-only"> site name</span></a></dd>
  </div>
  <div>
    <dt>Address</dt>
    <dd>https://fieldnotes.example</dd>
    <dd class="cap-summary-actions"><a href="#address" id="sl-change-address">Change<span class="cap-sr-only"> address</span></a></dd>
  </div>
  <div>
    <dt>Who is told</dt>
    <dd>Rosa Vega, by email<br />Failures at once; warnings in the morning digest</dd>
    <dd class="cap-summary-actions"><a href="#told">Change<span class="cap-sr-only"> who is told</span></a></dd>
  </div>
  <div>
    <dt>Quiet hours</dt>
    <dd class="cap-summary-missing">Not set</dd>
    <dd class="cap-summary-actions"><a href="#quiet">Add<span class="cap-sr-only"> quiet hours</span></a></dd>
  </div>
</dl>

Installation

// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/summary-list.css";

Usage

<dl class="cap-summary-list">
  <div>
    <dt>Address</dt>
    <dd>https://fieldnotes.example</dd>
    <dd class="cap-summary-actions"><a href="/sites/new/address">Change<span class="cap-sr-only"> address</span></a></dd>
  </div>
  <div>
    <dt>Quiet hours</dt>
    <dd class="cap-summary-missing">Not set</dd>
    <dd class="cap-summary-actions"><a href="/sites/new/quiet">Add<span class="cap-sr-only"> quiet hours</span></a></dd>
  </div>
</dl>

<dl class="cap-detail-record"><dt>Status</dt><dd>Blocked</dd></dl>

Examples

Without actions, two actions on a row, in a narrow column

<div id="sl-narrow-wrap">
  <dl class="cap-summary-list" id="sl-narrow">
    <div>
      <dt>Job</dt>
      <dd>Push design/capsomer</dd>
    </div>
    <div>
      <dt>Waits on</dt>
      <dd>A branch push. It cannot reach main.</dd>
      <dd class="cap-summary-actions"><a href="#approve">Approve<span class="cap-sr-only"> the push</span></a><a href="#decline">Decline<span class="cap-sr-only"> the push</span></a></dd>
    </div>
  </dl>
</div>

The detail panel's record: the same list without rows

<dl class="cap-detail-record">
  <dt>Status</dt>
  <dd>Blocked, waiting on you</dd>
  <dt>Posted by</dt>
  <dd class="cap-mono">agent:capsomer-driver</dd>
</dl>

API reference

Parts and data attributes

ClassIs
.cap-detail-recordits own class
.cap-summary-actionsits own class
.cap-summary-listthe root
.cap-summary-missingits own class

Accessibility

KeyDoes
TabReaches each Change link, row by row
EnterFollows it
  • Labels are dt and values dd; the actions are a dd too, as GOV.UK's are, so they are read with their row.
  • Labels in rows take the text color and weight (GOV.UK); the record form keeps its muted labels, 4.5:1 in both themes.