Summary list
Can be used to wrap a summary card around the summary list component.
Read the Design System guidance for summary list
Import
import { Root$1, Action, ActionComposite, Actions, ActionsList, ActionsListItem, Composite$1, Key, Row, RowComposite, Value } from 'govuk-react/summary-list';Examples
Default
Code
<SummaryList.Composite>
<SummaryList.RowComposite
term="Name"
value="Sarah Phillips"
actions={[
<SummaryList.ActionComposite key="Change" href="#" visuallyHiddenText="name">
Change
</SummaryList.ActionComposite>,
]}
/>
<SummaryList.RowComposite
term="Date of birth"
value="5 January 1978"
actions={[
<SummaryList.ActionComposite key="Change" href="#" visuallyHiddenText="date of birth">
Change
</SummaryList.ActionComposite>,
]}
/>
<SummaryList.RowComposite
term="Address"
value={
<>
72 Guild Street
<br />
London
<br />
SE23 6FH
</>
}
actions={[
<SummaryList.ActionComposite key="Change" href="#" visuallyHiddenText="address">
Change
</SummaryList.ActionComposite>,
]}
/>
<SummaryList.RowComposite
term="Contact details"
value={
<>
<Body>07700 900457</Body>
<Body>sarah.phillips@example.com</Body>
</>
}
actions={[
<SummaryList.ActionComposite key="Add" href="#" visuallyHiddenText="contact details">
Add
</SummaryList.ActionComposite>,
<SummaryList.ActionComposite key="Change" href="#" visuallyHiddenText="contact details">
Change
</SummaryList.ActionComposite>,
]}
/>
</SummaryList.Composite>With parts
Code
<SummaryList.Root>
<SummaryList.Row>
<SummaryList.Key>Name</SummaryList.Key>
<SummaryList.Value>Sarah Phillips</SummaryList.Value>
<SummaryList.Actions>
<SummaryList.ActionComposite href="#" visuallyHiddenText="name">
Change
</SummaryList.ActionComposite>
</SummaryList.Actions>
</SummaryList.Row>
</SummaryList.Root>Card
Code
<SummaryList.Card.Root>
<SummaryList.Card.TitleWrapper>
<SummaryList.Card.Title>University of Gloucestershire</SummaryList.Card.Title>
<SummaryList.Card.Actions>
<SummaryList.ActionComposite href="#" visuallyHiddenText="(University of Gloucestershire)">
Delete choice
</SummaryList.ActionComposite>
<SummaryList.ActionComposite href="#" visuallyHiddenText="(University of Gloucestershire)">
Withdraw
</SummaryList.ActionComposite>
</SummaryList.Card.Actions>
</SummaryList.Card.TitleWrapper>
<SummaryList.Card.Content>
<SummaryList.Root>
<SummaryList.Row>
<SummaryList.Key>Course</SummaryList.Key>
<SummaryList.Value>
English (3DMD)
<br />
PGCE with QTS full time
</SummaryList.Value>
</SummaryList.Row>
<SummaryList.Row>
<SummaryList.Key>Location</SummaryList.Key>
<SummaryList.Value>
School name
<br />
Road, City, SW1 1AA
</SummaryList.Value>
</SummaryList.Row>
</SummaryList.Root>
</SummaryList.Card.Content>
</SummaryList.Card.Root>API reference
Root$1
Can be used to wrap a summary card around the summary list component.
No props of its own. Other props are passed to the element it renders.
Action
| Prop | Type |
|---|---|
asChildRender the only child (such as a router's link) instead of an | boolean |
ActionComposite
| Prop | Type |
|---|---|
asChildRender the only child (such as a router's link) instead of an | boolean |
visuallyHiddenText | ReactNode |
Actions
| Prop | Type |
|---|---|
width | FluidWidth |
ActionsList
No props of its own. Other props are passed to the element it renders.
ActionsListItem
No props of its own. Other props are passed to the element it renders.
Composite$1
Wrap a summary list in a card.
| Prop | Type |
|---|---|
headingLevelHeading level, from | 1 | 2 | 3 | 4 | 5 | 6 |
titleData for the summary card header. | ReactNode |
actionsThe action link items shown in the header within the summary card wrapped around the summary list component. | any[] |
Key
| Prop | Type |
|---|---|
width | FluidWidth |
Row
| Prop | Type |
|---|---|
noActions | boolean |
noBorder | boolean |
RowComposite
Pass noActions on a row without actions when other rows have them.
| Prop | Type |
|---|---|
noActions | boolean |
noBorder | boolean |
termRequiredThe reference content (key) for each row item in the summary list component. | ReactNode |
valueRequiredThe value for each row item in the summary list component. | ReactNode |
actionsThe action link items within the row item of the summary list component. | any[] |
Value
| Prop | Type |
|---|---|
width | FluidWidth |