SummaryList
Basic key/value list
Section titled “Basic key/value list”- Full name
- Sarah Johnson
- Date of birth
- 12 March 1985
- Email address
- [email protected]
import {
SummaryList,
SummaryListRow,
SummaryListKey,
SummaryListValue,
} from '@eekodigital/raster';
<SummaryList>
<SummaryListRow>
<SummaryListKey>Full name</SummaryListKey>
<SummaryListValue>Sarah Johnson</SummaryListValue>
</SummaryListRow>
<SummaryListRow>
<SummaryListKey>Date of birth</SummaryListKey>
<SummaryListValue>12 March 1985</SummaryListValue>
</SummaryListRow>
<SummaryListRow>
<SummaryListKey>Email address</SummaryListKey>
<SummaryListValue>[email protected]</SummaryListValue>
</SummaryListRow>
</SummaryList> With action links
Section titled “With action links”Add a SummaryListActions cell to each row to provide contextual change links.
import {
SummaryList,
SummaryListRow,
SummaryListKey,
SummaryListValue,
SummaryListActions,
} from '@eekodigital/raster';
<SummaryList>
<SummaryListRow>
<SummaryListKey>Full name</SummaryListKey>
<SummaryListValue>Sarah Johnson</SummaryListValue>
<SummaryListActions>
<a href="#">Change<span class="sr-only"> full name</span></a>
</SummaryListActions>
</SummaryListRow>
<SummaryListRow>
<SummaryListKey>Date of birth</SummaryListKey>
<SummaryListValue>12 March 1985</SummaryListValue>
<SummaryListActions>
<a href="#">Change<span class="sr-only"> date of birth</span></a>
</SummaryListActions>
</SummaryListRow>
</SummaryList> Plain variant
Section titled “Plain variant”A lighter style with bold labels, regular-weight values, and no separator lines.
- Full name
- Sarah Johnson
- Date of birth
- 12 March 1985
- Email address
- [email protected]
<SummaryList variant="plain">
<SummaryListRow>
<SummaryListKey>Full name</SummaryListKey>
<SummaryListValue>Sarah Johnson</SummaryListValue>
</SummaryListRow>
<SummaryListRow>
<SummaryListKey>Date of birth</SummaryListKey>
<SummaryListValue>12 March 1985</SummaryListValue>
</SummaryListRow>
<SummaryListRow>
<SummaryListKey>Email address</SummaryListKey>
<SummaryListValue>[email protected]</SummaryListValue>
</SummaryListRow>
</SummaryList> When to use
Section titled “When to use”Use SummaryList for key-value pairs on review, confirmation, or detail screens — showing a user their submitted data before they confirm, or summarising a record’s attributes.
when you have multiple rows of comparable records rather than a single record’s fields.
SummaryList
Section titled “SummaryList”| Prop | Type | Default | Description |
|---|---|---|---|
variant | ”default” | “plain" | "default” | Visual style. |
children | ReactNode | — | One or more |
className | string | — | Additional CSS class names. |
SummaryListRow
Section titled “SummaryListRow”| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | A |
SummaryListKey
Section titled “SummaryListKey”| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | The label for the row. |
SummaryListValue
Section titled “SummaryListValue”| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | The data value for the row. |
SummaryListActions
Section titled “SummaryListActions”| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Action links or buttons for the row. |