Skip to content

List row

A two-line row you pick one of, as in a mail inbox: chips and an age, then the message, with selected and unread states.

ListInboxSelection
npx shadcn@latest add @silicon-ui/list-row

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/list-row

Manually

  1. Copy these files into your project

    • components/silicon-ui/list-row/list-row.tsx
    • components/silicon-ui/list-row/list-row.module.css
  2. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { ListRow } from "@/components/silicon-ui/list-row/list-row";

API reference

ListRow

PropTypeDefault
meta

The first line: chips, a sender, counts. Any nodes, in a row 8px apart. Wrap the one item that should take the room left, and end in "…" when it runs out, in ListRowText.

ReactNode—
end

The end of the first line, such as the age ("2h"): muted caption type, never wrapping.

ReactNode—
selected

The row that is open. It gets the muted fill and aria-current.

booleanfalse
unread

Not opened yet: the message, the ListRowText and the end are semibold in full-strength text, and screen readers hear "Unread." first. Read rows have their message in secondary text.

booleanfalse
onSelect

Called when the row is pressed.

() => void—
children

The second line, the message: two lines at most, then "…".

ReactNode—

Also accepts the props of ButtonHTMLAttributes<HTMLButtonElement>, except children, onSelect.

SelectableList

PropTypeDefault
label*

The list's name for screen readers, such as "Reports".

string—
children*

The rows: ListRow elements.

ReactNode—

Also accepts the props of HTMLAttributes<HTMLUListElement>, except children.

ListRowText

PropTypeDefault
children*

The words, or a Chip with `shrink` (a sender with its icon).

ReactNode—

Also accepts the props of HTMLAttributes<HTMLSpanElement>.

Dependencies

npm
None
Registry
None