Skip to main content
Components

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

PropType
asChild

Render the only child (such as a router's link) instead of an a, with the link classes merged onto it.

boolean

ActionComposite

PropType
asChild

Render the only child (such as a router's link) instead of an a, with the link classes merged onto it.

boolean
visuallyHiddenTextReactNode

Actions

PropType
widthFluidWidth

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.

PropType
headingLevel

Heading level, from 1 to 6. Default is 2.

1 | 2 | 3 | 4 | 5 | 6
title

Data for the summary card header.

ReactNode
actions

The action link items shown in the header within the summary card wrapped around the summary list component.

any[]

Key

PropType
widthFluidWidth

Row

PropType
noActionsboolean
noBorderboolean

RowComposite

Pass noActions on a row without actions when other rows have them.

PropType
noActionsboolean
noBorderboolean
termRequired

The reference content (key) for each row item in the summary list component.

ReactNode
valueRequired

The value for each row item in the summary list component.

ReactNode
actions

The action link items within the row item of the summary list component.

any[]

Value

PropType
widthFluidWidth