Data list

Lists label and value pairs about one thing.

Styles

  • Schedule
    0 * * * *
    Region
    eu-west-2 Prod
    Last run
    Succeeded14:02:51
    Owner
    None

    plaindefault

  • Schedule
    0 * * * *
    Region
    eu-west-2 Prod
    Last run
    Succeeded14:02:51
    Owner
    None

    framed

Orientation

  • Schedule
    0 * * * *
    Region
    eu-west-2 Prod
    Last run
    Succeeded14:02:51
    Owner
    None

    horizontaldefault

  • Schedule
    0 * * * *
    Region
    eu-west-2 Prod
    Last run
    Succeeded14:02:51
    Owner
    None

    vertical

Usage

When to use it
Use
The details of one pipeline, job, table or bucket: schedule, owner, region, last run.
Use
A key and value block beside a chart or at the top of a run.
Not for
Many things compared field by field; that is a table.
Not for
Two to six headline numbers. Use Status strip.
Not for
A list of things to open. Use Item.

Rules

6 rules
Never
Set a value in capitals or a label role; DataListValue keeps it as written in mono. Because values are copied and compared, and capitals change what an ID, a path or a region says.
Must
Pass prose for a value that is a sentence, such as a description. Because a sentence in mono reads slowly and wide, and Sodium sets every sentence in the sans.
Must
Pass an empty value through as null or ""; never a dash or "N/A". Because DataListValue writes None in text-3 for it, the same word everywhere, and a dash is read as "dash".
Never
Use variant="framed" inside a frame; use the default plain there. Because a frame inside a frame is the box in a box Sodium never draws.
Should
Write labels as one or two nouns in sentence case; the list sets the capitals.
Should
Put a Status or a Tag inside the value for a state, not a coloured word.

Accessibility

2 checks
A real dl with dt and dd, each pair in a div, as HTML allows.
Labels are text-2, 7.8:1; values text-1, 18.3:1; None text-3, 5.6:1.

Edge cases

4 edge cases
Long label
Wraps inside the 160px column; the values keep one edge.
Long value
Wraps anywhere, so a path never pushes the frame wider.
Under 24rem
Each label stacks over its value.
Empty value
Reads None in text-3.

API

4 props
variant
'plain' | 'framed' default 'plain'
orientation
'horizontal' | 'vertical' default 'horizontal'
DataListValue prose
boolean default false
className
string

Tokens

10 tokens
--label-col
160px
--row
40px
--line
#e2dfd5
--line-faint
#efede6
--text-1
#161512
--text-2
#55524a
--text-3
#6b675e
--type-label-sm
400 12px/16px var(--font-mono)
--type-code
400 13px/20px var(--font-mono)
--type-body-sm
400 14px/20px var(--font-sans)

Install

For your coding agent

GitHub

Please star me pookie

198

A new design system every week

Leave your email before you copy the prompt.