Summary list
About this component
Items in a summary list have:
- a question
- a response
- optional action buttons (buttons styled as links)
There's an item in the summary list for every question you've asked the user. If a user did not answer a question, show the question with an 'empty' response, such as 'not applicable' or 'not answered'.
Each action button should take the user back to the question it relates to. This lets the user change their response. Allowing users to correct errors is good form design.
When to use this component
Use a summary list in forms so users can review their responses.
You can include it:
-
as a separate page, to let users check their responses before submitting a form
-
on every page of a form, so users can track their answers while they progress
When not to use this component
Do not use a summary list for:
- tabular data, instead try using a table
- simple lists, instead try using an ordered or unordered list
- a list of tasks, instead try using a task list
Other versions of this component
Summary list without borders
If a summary list has no action buttons, you can also choose to remove the borders separating items in the list.
You can remove the borders by adding the ds_summary-list--no-border
modifier class to the summary list.
Do not remove the borders when there are action buttons. The borders help users to associate the action with the correct summary list item.
Summary card
If you show multiple summary lists on a page then you can separate them into cards. This adds visual separation between summary lists.
For example, summary cards are used in add more fields.
Summary cards can have action buttons that apply to the entire list, such as 'change' and 'delete'. They're buttons styled as links.
When using summary cards:
- only group related types of summary lists, such as people
- add card titles that say what information is within the card, such as a name
- make the card titles unique for each card
Evidence
This component is similar to the GOV.UK summary list component. Many UK government services use that component.
Website analytics
To track interactions with the action buttons in Google Analytics using Google Tag Manager, each button has a data attribute that describes the action.
The Design System’s ‘tracking’ script adds the data attributes.
Accessibility
The action buttons have an aria-describedby
attribute to help screen reader users understand the context. The attribute uses the ID of the question or the summary card that the button is related to.
Feedback, help and support
If you need help or support you can e-mail us at designsystem@gov.scot
There is a problem
Thanks for your feedback