List
Generic vertical list primitive, used as the base for ActivityFeed, InboxPanel, and one-off rows of items. Includes ListItem, ListSection, and ListDivider.
Component behavior
List is for collections that read as items rather than records: one primary label per row, optional supporting detail, no column alignment across rows. If values need to line up vertically across rows, use a table instead.
- Navigable collections — settings, channels, files, results.
- Rows with a label and secondary detail that need not align.
- Grouped content, via
ListSectionandListDivider.
Table: values should align into columns for comparison.
DataGrid: rows require sorting or selection.
VirtualList: large row counts require virtualization.
TreeView: items form a hierarchy.
List
List extends HTMLAttributes<HTMLUListElement>. Renders as <ul> by default, or <ol> when ordered is set.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "plain" | "divided" | "card" | "plain" | Divided adds borders between rows. Card adds a border around the list. |
density | "compact" | "normal" | "comfortable" | "normal" | Row spacing density. |
ordered | boolean | — | Renders as <ol> with ordered-list semantics. |
ListItem
ListItem extends LiHTMLAttributes<HTMLLIElement>. All content is passed as slots; a single component covers bare text, avatar rows, and complex rows.
| Prop | Type | Default | Description |
|---|---|---|---|
media | ReactNode | — | Content before the label. |
title | ReactNode | — | Primary row text. |
description | ReactNode | — | Secondary content below the title. |
meta | ReactNode | — | Right-aligned secondary content. |
actions | ReactNode | — | Trailing controls, kept out of the click target. |
selected | boolean | — | Selected highlight state. |
disabled | boolean | — | Greyed out, non-interactive. |
navigable | boolean | — | Shows a chevron and hover styling for navigation rows. |
ListSection
ListSection is a section heading inside a List.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Section heading text. |
action | ReactNode | — | Right-aligned content. |
sticky | boolean | — | Keeps the heading pinned while its section scrolls. |
ListDivider
ListDivider extends HTMLAttributes<HTMLLIElement>. A border between rows for lists that are otherwise "plain".
ListDividerProps has no custom props.
Examples
Card variant with media, title, description, meta
Selected and navigable items
Divided variant
import { List, ListItem, ListSection, ListDivider } from "@solarius/onset";