component
ListRow
One line in a list you read, not pick: something small at the start, a title over a line of detail, a value at the end, a line under it. For a list of payments, deadlines or files.
- Tax15 January 2027Income tax, fourth quarter€1,240
ListRowimport { ListRow } from 'rost/components/list-row/ListRow'
<ul>
<ListRow leading={<Badge status="warning" size="medium">Tax</Badge>} description="Income tax, fourth quarter" trailing="€1,240">
15 January 2027
</ListRow>
</ul> src/components/list-row/ListRow.tsx
import type { LiHTMLAttributes, ReactNode } from 'react'
import './list-row.css'
export interface ListRowProps extends Omit<LiHTMLAttributes<HTMLLIElement>, 'title'> {
/** What the row is about. */
readonly children: ReactNode
/** One line of detail under the title. */
readonly description?: ReactNode
/** Something small before the text: a Badge, an Avatar or an icon. */
readonly leading?: ReactNode
/** A value at the end, usually an amount or a date. */
readonly trailing?: ReactNode
}
const b = 'rost-list-row'
/**
* One line in a list you read, not pick. Put the rows in a `<ul>`.
* Built from contracts/list-row.contract.yaml.
*/
export function ListRow({ children, description, leading, trailing, className, ...rest }: ListRowProps) {
return (
<li className={[b, className].filter(Boolean).join(' ')} {...rest}>
{leading && <span className={`${b}__leading`}>{leading}</span>}
<span className={`${b}__text`}>
<span className={`${b}__title`}>{children}</span>
{description && <span className={`${b}__description`}>{description}</span>}
</span>
{trailing && <span className={`${b}__trailing`}>{trailing}</span>}
</li>
)
}
The source for everything on this page: contracts/list-row.contract.yaml (opens in a new tab). The CSS, the docs and the checks in each app are built from it.
# yaml-language-server: $schema=../schema/component-contract.schema.json
schemaVersion: 2
id: list-row
name: ListRow
kind: component
status: review
summary: "One line in a list you read, not pick: something small at the start, a title over a line of detail, a value at the end, a line under it. For a list of payments, deadlines or files."
category: display
related: [ list-item, description-list, table ]
source:
tool: figma
fileKey: 1Zy0wiWKXQAvsfDBX3KR0d
nodeId: "935:58"
url: https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=935-58
extractedAt: "2026-12-03"
extractedBy: hand
frozenAt: "2026-12-03"
props:
title: { type: slot, required: true, notes: "What the row is about. In React, the children." }
description: { type: slot, notes: "Optional, one line of detail under the title." }
leading: { type: slot, notes: "Optional, something small before the text: a Badge, an Avatar or an icon. Figma has a medium Badge." }
trailing: { type: slot, notes: "Optional, a value at the end, usually an amount or a date." }
elements:
root:
notes: "An `<li>`. Put the rows in a `<ul>` with no bullets. The row has no fill, only the line under it; the last row keeps it too, as Figma's single row does."
styles:
display: { value: flex, assert: false }
align-items: { value: center }
gap: { token: spacing/gap/large, value: 24px }
padding-top: { token: spacing/gap/small-medium, value: 12px }
padding-bottom: { token: spacing/gap/small-medium, value: 12px }
border-bottom-style: { value: solid, assert: false }
border-bottom-width: { token: spacing/outline/small, value: 1px }
border-bottom-color: { token: list-row/divider, value: "#282828" }
font-family: { token: font-family/base, value: "'General Sans Variable'" }
font-size: { token: typography/body/font-size, value: 16px }
line-height: { token: typography/body/line-height, value: 22px }
letter-spacing: { token: typography/body/letter-spacing, value: 0px }
list-style: { value: none, assert: false }
leading:
notes: "Holds the Badge or icon at its own size."
styles:
display: { value: flex, assert: false }
flex: { value: none, assert: false }
text:
notes: "The title over the description, taking the room that's left."
styles:
display: { value: flex, assert: false }
flex-direction: { value: column, assert: false }
flex: { value: "1 1 0", assert: false }
min-width: { value: 0px, assert: false }
title:
notes: "Body medium, in the main text colour. It can hold a small Badge after the words; they wrap under on a phone."
styles:
display: { value: flex, assert: false }
flex-wrap: { value: wrap, assert: false }
align-items: { value: center, assert: false }
gap: { token: spacing/gap/small, value: 8px }
font-weight: { token: typography/body/font-weight/medium, value: "500" }
color: { token: list-row/title, value: "#ededed" }
description:
notes: "Body regular, in the tertiary text colour."
styles:
font-weight: { token: typography/body/font-weight/regular, value: "400" }
color: { token: list-row/description, value: "#999999" }
trailing:
notes: "Body medium, in the main text colour, flush right."
styles:
flex: { value: none, assert: false }
text-align: { value: right }
white-space: { value: nowrap, assert: false, notes: "An amount stays on one line." }
font-weight: { token: typography/body/font-weight/medium, value: "500" }
color: { token: list-row/trailing, value: "#ededed" }
guidance:
status: proposed
use:
- title: A list of things to read
text: "Payments coming up, deadlines, files. Each row has a title, maybe a line of detail and a value at the end."
avoid:
- title: Rows you pick
text: "A row that opens something or gets selected. That's **ListItem**."
- title: Columns to compare
text: "When people read down a column, or sort it. That's **Table**."
- title: One thing's details
text: "A term and its value, a row each. That's **DescriptionList**."
behaviour: "Nothing to press. On a narrow screen the title wraps and the value stays on its line at the end."
accessibility:
element: "`<li>` in a `<ul>`, so a screen reader says how many rows there are."
colour: "Title and value are 17:1 on the dark page, the description 7:1. In light the description is 5.4:1."
content: "The title is the thing people scan for, often a date. Keep the description to one line. Format the value for the reader, with its currency."
Install
npx github:Runceanu/rost add list-row It lands in src/rost/list-row/, with what it needs and its contract. Install has the rest.
When to use
A list of things to read
Payments coming up, deadlines, files. Each row has a title, maybe a line of detail and a value at the end.
When not to use
Rows you pick
A row that opens something or gets selected. That's ListItem.
Columns to compare
When people read down a column, or sort it. That's Table.
One thing's details
A term and its value, a row each. That's DescriptionList.
Behaviour
Nothing to press. On a narrow screen the title wraps and the value stays on its line at the end.
Accessibility
- Element
<li>in a<ul>, so a screen reader says how many rows there are. - Colour
Title and value are 17:1 on the dark page, the description 7:1. In light the description is 5.4:1.
Content
The title is the thing people scan for, often a date. Keep the description to one line. Format the value for the reader, with its currency.
Props
| Prop | Type | Values | Default |
|---|---|---|---|
title | slot | | |
description | slot | | |
leading | slot | | |
trailing | slot | | |
Values
Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.
Never changes
root
-
gap24pxspacing/gap/large -
padding-top12pxspacing/gap/small-medium -
padding-bottom12pxspacing/gap/small-medium -
border-bottom-width1pxspacing/outline/small -
border-bottom-color#282828list-row/divider -
font-family'General Sans Variable'font-family/base -
font-size16pxtypography/body/font-size -
line-height22pxtypography/body/line-height -
letter-spacing0pxtypography/body/letter-spacing
displayflex · align-itemscenter · border-bottom-stylesolid · list-stylenone
leading
displayflex · flexnone
text
displayflex · flex-directioncolumn · flex1 1 0 · min-width0px
title
-
gap8pxspacing/gap/small -
font-weight500typography/body/font-weight/medium -
color#edededlist-row/title
displayflex · flex-wrapwrap · align-itemscenter
description
-
font-weight400typography/body/font-weight/regular -
color#999999list-row/description
trailing
-
font-weight500typography/body/font-weight/medium -
color#edededlist-row/trailing
flexnone · text-alignright · white-spacenowrap