Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a summary list example where only some rows have actions #1990

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/summary-list/index.md.njk
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ To give more context, add visually hidden text to the links. This means a screen

{{ example({group: "components", item: "summary-list", example: "default", html: true, nunjucks: true, open: false, titleSuffix: "second"}) }}

If you have a mix of rows with and without actions, add the `govuk-summary-list__row--no-actions` modifier class to the rows without actions.

{{ example({group: "components", item: "summary-list", example: "mixed-actions", html: true, nunjucks: true, open: false}) }}

### Removing the borders

The summary list includes some separating borders to help users read each row and its action.
Expand Down
70 changes: 70 additions & 0 deletions src/components/summary-list/mixed-actions/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: Summary list with a mix of rows with and without actions
layout: layout-example.njk
---

{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}

{{ govukSummaryList({
rows: [
{
key: {
text: "Name"
},
value: {
text: "Sarah Philips"
}
},
{
key: {
text: "Date of birth"
},
value: {
text: "5 January 1978"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "date of birth"
}
]
}
},
{
key: {
text: "Address"
},
value: {
html: "72 Guild Street<br>London<br>SE23 6FH"
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "address"
}
]
}
},
{
key: {
text: "Contact details"
},
value: {
html: '<p class="govuk-body">07700 900457</p><p class="govuk-body">sarah.phillips@example.com</p>'
},
actions: {
items: [
{
href: "#",
text: "Change",
visuallyHiddenText: "contact details"
}
]
}
}
]
}) }}