List row

Free

The dense row every list shares: a status node, avatar or logo, a title with one grey line, and a value or time. Runs shimmer while they work, open from the keyboard and fold out to show the work.

npx shadcn@latest add https://pixilui.com/r/list-row.json

Preview

A run row shimmers while it works and folds out to show who approved it and what it did.
Size

When to use

Use it when

  • Add in place: an add row at the end of a list that turns into a search picker (connect a source, invite someone).
  • A list in a panel that grows into a table when the panel is wide enough (deals by stage).
  • Runs, logs, members, sources and activity: one mark, a title, one grey line and one value or time per row.
  • A row that opens a page (onOpen): Enter opens it, Up and Down move between rows.
  • A row that folds out (detail): what an agent read, who approved it, what it did, as a key-value list.
  • kind="timeline" for an activity log: a dot on one line, the time, the title, who did it and a note.

Use something else when

  • Records with several columns: use the sortable table.
  • Agent avatars, names, durations and chevrons on every run row: one mark, one line, one value ("way too much overwhelming").
  • A settings form: use a field or a switch row.

Installation

Terminal
npx shadcn@latest add https://pixilui.com/r/list-row.json

Adds list-row.tsx with field.tsx, and installs clsx and tailwind-merge. The URL works in any app with a components.json, with no registry to add first.

Usage

example.tsx
import { ListRow } from "@/components/pixilui/list-row";

<ListRow onOpen={onOpen} onExpandedChange={onExpandedChange}>Save changes</ListRow>

Fills its container; the title and grey line truncate, the end stays whole.

API reference

PropTypeDefault
leadReactNode–What leads the row: a status node, an avatar, a logo or a checkbox (24).
titleReactNode–The row's name.
metaReactNode–A quiet word beside the title ("pages").
subReactNode–The grey second line ("Reading 14 invoices").
valueReactNode–A number that lines up down the list (tabular).
timeReactNode–A short time ("2h ago"), lined up at the end.
staleboolean–stale writes the time in the warning color.

Also takes every native <div> attribute except title, and a ref.

Keyboard

Enter SpaceOpens a row that opens, or folds out a row with a detail (no motion from the keyboard).
↑ ↓Moves between rows that open; in the add row's picker, moves the highlight.
EnterIn the add row's picker, adds the highlighted option.
EscIn the add row's picker, turns it back into the add row.

Accessibility

  • List and listitem roles; a row that opens is focusable and named by aria-label; a row that folds out has aria-expanded.
  • Open is aria-current, picked is aria-selected, off is aria-disabled. Failed is words in red, never only the color.
  • Focus is a 1px ring, the plain ring the fields use.

Motion

  • Hover washes the row in 150ms (lively: rounded, the lines beside it step back; quiet: square and full width).
  • A running row's grey line carries the locked text shimmer.
  • A detail folds with the system's fold; a row added later arrives with the system's arrive (a 2 to 3px rise out of a 3px blur) while the rows below glide down (flip).
  • A removed row fades into a blur, a hair smaller, then the rest glide up to close the gap. Load more's rows arrive 35ms apart while the list glides to its new height.
  • Growing into a table: the value and time slide to their columns over 420ms, and the wide-only cells arrive.
  • The add row's picker: the menu's highlight glides between options (150ms), and jumps on the first.
  • Keyboard actions never animate. Reduced motion turns every transition off.
Sortable tableClick a header and rows glide into order; pick rows and the bulk bar rises.
Key-value listLabel and value pairs that wrap long values without breaking the grid.
Status dotOne node for every run state, so waiting on you looks the same everywhere.

PixilUI Pro opens soon. The first 20 licenses are $99.