Summary list

The summary list shows read-only facts as key-value rows, such as the answers on a "check your answers" page before a form is submitted. Each row can carry one action, such as a Change link, that takes the user back to edit that answer.

The list renders a native description list (<dl>): each key is a term (<dt>) and each value is its definition (<dd>), so assistive technology reads every key with its value.

When to Use

✅ Use the summary list when:

  • Users check their answers before they submit a form.
  • A page shows a short set of facts about one thing, such as a case, an application or a person.
  • Each fact may need its own Change action.

❌ Don't use the summary list when:

  • The data has several columns or needs sorting; use the table or the data table instead.
  • Users edit the values in place; use form fields instead.
  • The list is long and needs a "show more" toggle; the summary list does not collapse.
Examples Setting the rows

The rows are data, set through the items property. items is a property only, not an attribute, so set it from JavaScript or through a framework property binding.

Each item is { key, value, action? }:

FieldTypeDescription
keystringThe term of the row, e.g. "Date of birth".
valuestringThe value, as text. Line breaks (\n) are kept. An empty string renders an empty definition.
action{ label: string, href?: string }Optional. An action at the end of the row.

JS

<dap-ds-summary-list id="answers"></dap-ds-summary-list>

<script>
  document.querySelector('#answers').items = [
    { key: 'Full name', value: 'Kovács Anna' },
    { key: 'Date of birth', value: '1990-01-01' },
    { key: 'Address', value: '1051 Budapest\nFő utca 1.' },
  ]
</script>

React

import { DapDSSummaryList } from 'dap-design-system/react'

const answers = [
  { key: 'Full name', value: 'Kovács Anna' },
  { key: 'Date of birth', value: '1990-01-01' },
  { key: 'Address', value: '1051 Budapest\nFő utca 1.' },
]

<DapDSSummaryList items={answers} />

Values are plain text and are never parsed as HTML. Pass your own placeholder text, such as "Not provided", when an answer is empty and you want to show that.

Actions

Give a row an action to show an action at its end. An action with an href renders a dap-ds-link; an action without one renders a dap-ds-button.

The action's visible text is its label, followed by the row's key in visually hidden text. A screen reader user who moves from action to action hears "Change Date of birth", not several identical "Change" actions. Keep the label short and do not repeat the key in it.

Activating an action fires dds-action with the row's index in items and its key. Links also navigate to their href as usual.

JS

const list = document.querySelector('dap-ds-summary-list')

list.items = [
  { key: 'Full name', value: 'Kovács Anna', action: { label: 'Change', href: '/apply/name' } },
  { key: 'Date of birth', value: '1990-01-01', action: { label: 'Change' } },
]

list.addEventListener('dds-action', event => {
  const { index, key } = event.detail
  // e.g. go back to the step that asked this question
  goToQuestion(index)
})

React

import { DapDSSummaryList } from 'dap-design-system/react'

<DapDSSummaryList
  items={[
    { key: 'Full name', value: 'Kovács Anna', action: { label: 'Change', href: '/apply/name' } },
    { key: 'Date of birth', value: '1990-01-01', action: { label: 'Change' } },
  ]}
  onDdsAction={event => goToQuestion(event.detail.index)}
/>

For client-side routing, leave out href and navigate in the dds-action handler, so the page does not reload.

Layout and narrow containers

When there is room, each key sits beside its value and the action sits at the end of the row. When the summary list is narrower than 480px, each key stacks above its value and the action moves below the value.

The layout follows the width of the summary list itself, not the width of the viewport, so the same list works in a wide page and in a narrow side panel. The threshold is a fixed size. It cannot be changed with a CSS custom property, because CSS custom properties cannot be used in container query conditions. The summary list is a CSS size container (container-type: inline-size), so it takes its width from its parent and not from its content: inside a flex row, give it a width.

Custom Styling

Change the key column width, spacing, borders and text styles with the --dds-summary-list-* custom properties, or style the base, row, key, value, value-text and action parts.

dap-ds-summary-list {
  --dds-summary-list-key-width: 40%;
  --dds-summary-list-border-color: transparent;
}

dap-ds-summary-list::part(key) {
  font-weight: var(--dds-font-weight-medium);
}
Accessibility Features
  • Description list semantics: the whole list renders in one shadow root as a native <dl>, so every key is a term and its value is the definition next to it.
  • Named actions: each action's accessible name is its label plus the row's key, such as "Change Date of birth".
  • Real links and buttons: actions are DDS links or buttons, so they work with the keyboard and are announced with their role.
  • Text values: values keep their line breaks with CSS, without extra markup.
Importing Per-component import (Recommended)

Import the component by its own subpath. This registers <dap-ds-summary-list> (and the components it renders internally) and lets your bundler include only what you use:

import 'dap-design-system/components/summary-list'

Need a reference to the class (e.g. to register it manually or extend it)? The same subpath default-exports it:

import DapDSSummaryList from 'dap-design-system/components/summary-list'
Register everything

Register the whole library at once — convenient, but pulls every component into your bundle:

import 'dap-design-system'
Importing React
import { DapDSSummaryListReact } from 'dap-design-system/react'
Attributes
PropertyTypeDefaultDescription
itemsDapDSSummaryListItem[][]The rows, as { key: string, value: string, action?: { label: string, href?: string } } objects.
Set as a property only, not as an attribute. An action with an href renders a link, otherwise a
button; its accessible name is its label followed by the row's key.
ariaLabelstring, nullnullAccessible label for the element. Use this to provide a text alternative
for elements that don't have visible text content.
ariaExpanded'true', 'false'nullIndicates whether the element is expanded or collapsed.
ariaControlsstring, nullnullIdentifies the element that is controlled by this element.
ariaHasPopupstring, nullnullIndicates the availability and type of interactive popup element.
ariaDescribedBystring, nullnullIdentifies the element that describes the current element.
ariaPressed'true', 'false' , 'mixed'nullIndicates the current "pressed" state of toggle buttons.
ariaHidden'true', 'false'nullIndicates whether the element is hidden from accessibility APIs.
customStylesstring, undefinedCustom CSS text to be merged with the component's styles.
This CSS will be injected into the shadow DOM and merged with the component's static styles.
Slots

No slots available.

Events
Event NameDescriptionType
dds-actionFired when a row's action is activated, with the row's index and key.{index: number, key: string }
CSS Parts
Part NameDescription
baseThe description list.
rowA row, holding its key, value and action.
keyThe key (term) of a row.
valueThe value (definition) of a row.
value-textThe text of a value.
actionThe action container of a row.
How to Use CSS Parts

You can style CSS parts using the ::part() pseudo-element selector:

/* Target a specific part */
.my-custom-dap-ds-summary-list::part(base) {
  /* Your custom styles */
}

/* Target multiple parts */
.my-custom-dap-ds-summary-list::part(base),
.my-custom-dap-ds-summary-list::part(row) {
  /* Shared styles */
}

Example usage:

<dap-ds-summary-list class="my-custom-dap-ds-summary-list">
  Summary list
</dap-ds-summary-list>
.my-custom-dap-ds-summary-list::part(base) {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

CSS parts allow you to style internal elements of the component while maintaining encapsulation. Learn more in our styling guide.

CSS Custom Properties
Property NameDescription
--dds-summary-list-key-widthWidth of the key column in the side-by-side layout. (default: 30%)
--dds-summary-list-column-gapGap between the key, value and action in the side-by-side layout. (default: var(--dds-spacing-400))
--dds-summary-list-row-gapGap between the key, value and action in the stacked layout. (default: var(--dds-spacing-100))
--dds-summary-list-row-padding-blockBlock padding of a row. (default: var(--dds-spacing-300))
--dds-summary-list-border-widthWidth of the border below each row. (default: var(--dds-border-width-base))
--dds-summary-list-border-colorColor of the border below each row. (default: var(--dds-border-neutral-subtle))
--dds-summary-list-font-sizeFont size of the list. (default: var(--dds-font-base))
--dds-summary-list-line-heightLine height of the list. (default: var(--dds-font-line-height-xlarge))
--dds-summary-list-key-colorText color of the keys. (default: var(--dds-text-neutral-strong))
--dds-summary-list-key-font-weightFont weight of the keys. (default: var(--dds-font-weight-bold))
--dds-summary-list-value-colorText color of the values. (default: var(--dds-text-neutral-base))
--dds-summary-list-value-font-weightFont weight of the values. (default: var(--dds-font-weight-medium))
How to Use CSS Custom Properties

CSS custom properties (CSS variables) can be set directly on the component or in your stylesheet:

Method 1: Inline styles (Quick customization)

<dap-ds-summary-list
  style="--dds-summary-list-key-width: value; --dds-summary-list-column-gap: value;">
  Summary list
</dap-ds-summary-list>

Method 2: CSS classes (Reusable styles)

.my-custom-dap-ds-summary-list {
  --dds-summary-list-key-width: value;
  --dds-summary-list-column-gap: value;
  --dds-summary-list-row-gap: value;
}
<dap-ds-summary-list class="my-custom-dap-ds-summary-list">
  Summary list
</dap-ds-summary-list>

Method 3: Global theme customization

/* Apply to all instances */
dap-ds-summary-list {
  --dds-summary-list-key-width: value;
  --dds-summary-list-column-gap: value;
}

CSS custom properties inherit through the Shadow DOM, making them perfect for theming. Changes apply immediately without rebuilding.