Item

Shows one thing as a row in a list.

Sizes

Media

States

Usage

When to use it
Use
A list of things a person opens one at a time: tables, pipelines, workers, buckets.
Use
A short list in a panel, where a table's columns would be empty.
Not for
Rows compared column by column, sorted or selected in bulk; that is a table.
Not for
Label and value pairs about one thing. Use Data list.

Rules

6 rules
Must
Put Items in an ItemGroup; variant="plain" inside a frame that already has the edge. Because the group is the list role and the frame, and a framed group inside a frame draws a box in a box.
Never
Set an Item's name in capitals or a label role; ItemTitle keeps it as written. Because names are identifiers people compare and copy, and orders_daily in capitals is a different string.
Must
Make a row that opens something an ItemLink inside ItemTitle, not an onClick on the Item. Because the link covers the row with one tab stop and its ring inside the row, while a clickable div is not reachable by keyboard.
Never
Mark the chosen row with a bar down one edge or a bold name; pass selected. Because Sodium marks a place you are with the selection wash, and a side rail is the habit of generated UI.
Must
Keep ItemActions to ghost icon buttons or one secondary small Button; never a primary. Because a slab on every row is a slab per row, and the one primary belongs to the page.
Should
Lead with a StatusMark when every row has a state, and keep the word in ItemMeta or a Status.

State order

5 states, highest first
1
disabled
2
focus-visible
3
selected
4
hover
5
rest

Accessibility

4 checks
ItemGroup is role="list" and each Item a listitem.
An ItemLink row takes one tab stop; its 2px ring is drawn inside the row so the frame cannot clip it.
Names are text-1 18.3:1, descriptions text-2 7.8:1, meta text-3 5.6:1; on the selection wash 16.5, 7.0 and 5.1:1.
Set aria-current="page" on the selected row's link.

Keyboard

1 key
Tab
Moves to the next row link, then its actions.

Edge cases

4 edge cases
Long name
Truncates last, after the meta has gone.
Under 28rem
The meta drops; actions never do.
Two-line description
Clamps at two lines; the lead aligns to the top.
Forced colours
The selected row draws a 2px outline inside its edge.

API

6 props
size
'default' | 'sm' default 'default'
selected
boolean default false
disabled
boolean default false
ItemGroup variant
'framed' | 'plain' default 'framed'
ItemMedia variant
'default' | 'icon' default 'default'
render
ReactElement

Tokens

16 tokens
--row
40px
--row-sm
32px
--line
#e2dfd5
--line-faint
#efede6
--hover
rgb(22 21 18 / 0.04)
--pressed
rgb(22 21 18 / 0.08)
--selected
#fff4bf
--selected-strong
#ffec99
--text-1
#161512
--text-2
#55524a
--text-3
#6b675e
--text-disabled
#a8a499
--type-code
400 13px/20px var(--font-mono)
--type-code-sm
400 12px/16px var(--font-mono)
--type-caption
400 13px/18px var(--font-sans)
--focus
#7a5d00

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.