ListRow
HkListRow is one entry of a card list: an optional tone-tinted icon chip, a main column (title, subtitle and a free-form default slot), and a trailing column pinned to the inline end for badges, switches or buttons. The row is a role="listitem" by default and only becomes a control when you ask it to — clickable adds the whole-row drill-through (cursor, hover wash, focus ring, tab stop, Enter and Space). The anatomy — bordered surface, rows at one inset a hairline apart, never a raw ul / ol — is the console family's "card rows" standard, and it was copy-pasted across ten views before it became a component.
- The band that stacks these rows and owns the list surface, the hairline dividers and the empty state is CardList. This page covers the row alone.
- Reach for a row when each entry is a record read top to bottom: a server, a theme, a saved query. When the data is tabular — several comparable columns per record — the list is a table instead.
- Rows ship with two kinds of row-level controls: the trailing slot (always visible, part of the record's own content) and the actions lane (name-labelled icon buttons that stay hidden until engaged). The trailing slot is where the row keeps its resting controls; actions is where the row's option menu lives.
- An actions array of one is the same "row actions" idea as RowActions, which is the standalone trigger-plus-popup component the rest of the library uses. The two are different components with different markup; which one to use is the subject of the last section.
Import
;
use *; // ListRow, card_list_icon_tone, StatTone
use *; // ListRowProps, rsx!, VNode, MdiIcon, EventHandler, MouseEvent
The Rust form is a plain function, ListRow(ListRowProps { … }); inside rsx! the element form is ListRow { … } and every prop may be omitted. The component has no stylesheet of its own: its rules live in the card list's sheet, which the Rust registry already carries under card-list.
Anatomy: icon, main column and trailing
The row is a flex line of up to three cells. icon (Vue: any icon component) renders inside the standard HkIconChip, and iconTone picks its tint from the stat-card palette — primary by default, plus success, warning, error, info and muted. The main column follows: title and subtitle each get their own line and both ellipsize rather than widening the row, and the default slot renders under them as the row's free-form body. The trailing cell is the trailing slot, pushed to the inline end and rendered only when the slot carries something.
Leaving icon out drops the chip cell entirely, so the main column starts at the row's own inset. Vue types icon as a component and mounts it at the chip's own glyph size; the Rust mirror takes a typed MdiIcon and renders the same chip, so the two forms produce identical boxes with different glyph plumbing.
A row's free-form body is the default slot (Vue slots.default, Rust children), rendered after the subtitle inside the main column. It is the place for a progress bar, a tag row, a paragraph — anything that is still part of the record's identity rather than of its trailing controls, which is why the slot is inside the main column and not beside it.
Drill-through and the click that stops at the edge
clickable turns the whole row into a press target. It sets the pointer cursor and hover wash, gives the row tabindex="0", and makes Enter and Space emit click with the originating event — the same event a pointer press emits. Without clickable the row is inert: no tab stop, no handler, no cursor change.
Two guards come with that. Presses inside the trailing column and inside the actions lane stop at their wrapper, so a switch toggled in the trailing cell or a delete button in the action lane never also selects the row — the 2026-11-13 field report was a per-row delete that also opened the row. The keyboard synthesises an ordinary bubbling click on the focused button, so the guard lives on the containers and covers both paths.
[D] The guard is also why the keyboard walk differs between the two forms. Vue checks e.target !== e.currentTarget in the row's keydown handler and leaves keys that bubble up from focusable children alone; the Rust mirror has no event target, so its keydown handler reads the key and acts — the bubbling guard is spelled through Vue's extra check rather than through the mirror.
Last opened: nothing yet · archived: false
The Rust ListRow takes the click emit as onclick; the mirror clones it twice, once into the pointer handler and once into the keydown handler, so the two call sites share one handler value and neither arm can outlive it. The Vue form below is the interactive one: the first row updates the tally when pressed and the second one's switch toggles without touching it, which is the stop-propagation contract seen live.
The action lane: overlay, persistent, and the touch menu
actions is the row's option-control array: { name, icon?, danger?, disabled?, onSelect }. name is required, because it is the button's only identity — the tooltip's text on pointer devices and the menu row's label on touch, where a tooltip never fires.
actionsMode picks the layout. overlay (the default) parks the array out of the flow: it costs the row no width, stays hidden, and temporarily covers the trailing content while engaged — hover or keyboard focus on pointer devices, a tap on touch. persistent gives the array the last column and keeps it visible. role="toolbar" and actionsLabel name the lane for the former layout.
The lane also has a second face, chosen by the device rather than by a prop. On a touch-first viewport the row renders one ⋯ trigger instead of the per-action buttons; that trigger carries aria-haspopup="menu" and aria-expanded, opens a popup menu whose rows are the action names, and only the chosen action's onSelect runs. actionsMenuLabel names that trigger and the menu's title, falling back to actionsLabel.
The lane is Vue-only. The Rust ListRow has no actions, no actionsMode and no touch trigger — a Rust row's controls are the ones the host puts in trailing.
Log: nothing selected yet
No event carries a lane press, so the row still has exactly one emit — click — and the lane never produces it: each action's own onSelect is the report, exactly like the per-action callbacks of Tabs's attached actions.
Row actions inside a row, and RowActions beside it
Two components now offer "a ⋯ on a row", and they are not interchangeable:
- The lane (this component's actions) is a property of a list row. It is a toolbar of named icon buttons on pointer devices and a single menu trigger on touch, it lives inside the row's own last column, and it is fed by the HkListRowAction array.
- HkRowActions is a standalone ghost icon button with an optional HkMenu popup, open / select emits, a size step and a localized default label. It is the general row-control affordance for tables and any other container that is not a card list. See RowActions.
A card list that wants the plain ⋯-plus-menu affordance can put an HkRowActions in trailing instead of using the lane; a table row uses HkRowActions and has no lane at all.
API
Vue
Props
| Name | Type | Default | Required |
|---|---|---|---|
| icon | [Object, Function] as PropType<Component> | undefined | — |
| iconTone | String as PropType<StatTone> | "primary" | — |
| title | String | undefined | — |
| subtitle | String | undefined | — |
| clickable | Boolean | false | — |
| actions | Array as PropType<HkListRowAction[]> | undefined | — |
| actionsMode | String as PropType<HkListRowActionsMode> | "overlay" | — |
| actionsLabel | String | undefined | — |
| actionsMenuLabel | String | undefined | — |
Emits
| Event | Payload |
|---|---|
| click | <code>MouseEvent | KeyboardEvent</code> |
Rust
Props — ListRow
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | Option<MdiIcon> | None | The leading glyph (Vue: an icon component through HkIconChip). |
| icon_tone | StatTone | StatTone::Muted | — |
| title | Option<String> | None | — |
| subtitle | Option<String> | None | — |
| clickable | bool | false | Whole-row click (drill-through). |
| onclick | Option<EventHandler<MouseEvent>> | None | — |
| trailing | Option<Element> | None | The trailing slot: badges, switches, actions. |
| children | Element | (empty) | — |
Accessibility
- The row is role="listitem"; CardList supplies the role="list" around it, and the two belong together — a list item outside a list is announced as nothing in particular.
- clickable is what makes the row reachable: it adds tabindex="0" and an Enter / Space handler, so the row is one Tab stop and behaves like a button without claiming the role. A clickable row inside a container that already navigates (a link-wrapped tile) would put two activations on one stop.
- The icon chip is aria-hidden, so an icon-only row has no accessible text at all. Give such a row a title or a subtitle, or make its default slot carry the text the chip is standing in for.
- [D] The chip's default tint differs: Vue's iconTone defaults to primary, while the Rust icon_tone field carries no #[default] of its own and therefore falls back to StatTone's default, muted. A Rust row that should lead with a primary chip has to pass icon_tone: StatTone::Primary explicitly; leaving it out renders a grey chip where the Vue row shows a tinted one.
- name on each action is the button's accessible name (aria-label) and not decoration: an action with no name renders an unnamed button. actionsLabel names the toolbar, so the lane arrives as "Record actions, toolbar" rather than as a run of loose buttons.
- On touch the lane collapses to one trigger carrying aria-haspopup="menu" and aria-expanded, so the open state is announced; the menu's own rows carry the same names the pointer lane shows as tooltips.
- The click guard is semantic, not cosmetic: without it a row-level delete would also drill through, and a keyboard user would get both actions from one Enter.
Related components
- CardList — the surface that stacks rows, draws the hairlines and renders the empty state.
- RowActions — the standalone ⋯ trigger and its menu, for rows that are not card-list entries.
- Badge — the usual content of a trailing cell.
- Switch — the trailing control that proves the click guard: it toggles without opening the row.
- IconChip — the chip the leading icon renders through, with its tone palette.