List
<ul> built from a content array: each item is text, a link (to / href) or a selectable row. Pass
interactive for rows that keyboards and screen readers reach, or static for display-only rows.When to use
- A short list of options with single or multiple selection, or a side menu.
- A phone list of tappable rows with a title, description, meta and trailing control (
interactive). - Display-only rows that span a card — a label over a
Meter, a name over its meta (static).
Usage
- Item 1
- Item 2
- Item 3
import { List } from '@apollion-dsi/core/elements/list';
<List content={[{ title: 'Item 1' }, { title: 'Item 2' }, { title: 'Item 3' }]} />;Without interactive or static, items are single-line lis that respond to the pointer only. That is the layout
Dropdown menus use.
Selection
A click toggles an item; selecting one clears the others. multiple keeps several selected, showCheckIcon marks
them, and exclusive keeps exactly one on (a click on the selected row keeps it). isSelected in content stays in
sync after mount. onSelectItems receives the whole list; onItemClick receives the clicked item.
- Light
- Dark
- System
<List exclusive showCheckIcon content={themes} onItemClick={(item) => setTheme(item.id)} />Interactive rows
interactive puts a <button type="button"> in each li, or a Link when the item has to
/ href. Rows are at least 44px tall, titles wrap, and description, meta and trailing render. trailing sits
beside the row's control, never inside it, so a Switch there is not nested in a button.
import { Link as RouterLink } from 'react-router-dom';
<List interactive linkAs={RouterLink} onItemClick={(item) => openRun(item.id)} content={runs} />;Link items render a native <a href> (from href, else to) and skip the toggle. Pass the app's link component as
linkAs for client routing; it receives to / href as given. An external href always renders a native <a>.
Static rows
static renders rows that are read, not tapped. The text column grows to the row and wraps, so a
Meter in description spans the card. No handler, hover or 44px floor; selection props
are ignored. An item with to / href renders its title as a link. interactive wins when both are set.
- Pass rate82%
- Review gate41%
<List static content={[{ title: 'Pass rate', description: <Meter label="Pass rate" value={82} />, trailing: '82%' }]} />Accessibility
- Use
interactivefor any row a keyboard or screen-reader user must reach:Tabreaches every row andEnteractivates it (Spacetoo on a button row). - Selection is announced as
aria-pressedin a selection mode (multiple,exclusive,showCheckIcon), else asaria-current. - Give a trailing control its own accessible name (
<Switch aria-label="…" />). - One primary action per row, plus at most one
trailingcontrol.
Properties
alignContent"center""start""end""between""around""evenly""stretch"nonecontainmentstringnonecontent *ListContentType[]nonecqPartial<Record<ContainerSizeTypes, Partial<Omit<Partial<{ area: string; padding: stringnumber; margin: stringnumber; isHidden: boolean; truncate: boolean; lineClamp: number; pageShell: boolean; ... 14 more ...; transform: string; }>, "containment"> & Partial<...> & SizeFactoryProps & Partial<...>>>>noneenableBreakpoint"xs""xl""sm""md""lg"noneexclusivebooleanfalseignoreResponsivebooleannoneinteractivebooleanfalsejustifyItems"center""start""end""stretch"nonelineClampnumbernonelinkAsElementType<any, keyof IntrinsicElements>'a'multiplebooleanfalseonItemClick((l: ListContentType) => void)noneonSelectItems((l: ListContentType[]) => void)nonepageShellbooleannoneplaceItems"center""start""end""stretch"noneshowCheckIconbooleanfalsestaticbooleanfalsetransformstringnoneviewportMediasPartial<Record<keyof BreakPoint<any>, Partial<Omit<Partial<{ area: string; padding: stringnumber; margin: stringnumber; isHidden: boolean; truncate: boolean; lineClamp: number; pageShell: boolean; ... 14 more ...; transform: string; }>, "containment"> & Partial<...> & SizeFactoryProps & Partial<...>>>>undef...noneBeyond the props above, every component accepts the layout props (spacing, color, flex/grid, sizing, border) — not repeated here.