Data display
List
Free1.8 KB gzippedA semantic list (<ul> or <ol>) with styled markers and rich items.
Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · Keys: Tab · Full report
Import
import { List } from "@vjdesigns/vjdesigns-ui";
Importing only List adds about 1.8 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.
Examples
Divided
Items have start, title, description, meta and end slots.
- JLJordan Lee Product designerAdmin
- SRSam Rivera EngineerMember
- PPPriya Patel EngineerMember
import { Avatar, Badge, List } from "@vjdesigns/vjdesigns-ui";
export function Divided() {
return (
<List variant="divided" style={{ width: "100%", maxWidth: "28rem" }}>
<List.Item
start={<Avatar name="Jordan Lee" colorFromName />}
title="Jordan Lee"
description="Product designer"
end={<Badge tone="success">Admin</Badge>}
/>
<List.Item start={<Avatar name="Sam Rivera" colorFromName />} title="Sam Rivera" description="Engineer" end={<Badge>Member</Badge>} />
<List.Item start={<Avatar name="Priya Patel" colorFromName />} title="Priya Patel" description="Engineer" end={<Badge>Member</Badge>} />
</List>
);
}
Interactive
List.ItemButton and List.ItemLink make whole rows interactive. List.Subheader goes before the list, which points to it with aria-labelledby.
Recent
import {
ChevronRightIcon,
FileIcon,
FolderIcon,
List,
} from "@vjdesigns/vjdesigns-ui";
export function Interactive() {
return (
<div style={{ width: "100%", maxWidth: "28rem" }}>
<List.Subheader id="recent-files">Recent</List.Subheader>
<List variant="card" aria-labelledby="recent-files">
<List.ItemButton start={<FolderIcon />} title="Brand assets" meta="Today" end={<ChevronRightIcon />} />
<List.ItemButton start={<FileIcon />} title="Q3 roadmap.pdf" meta="Yesterday" end={<ChevronRightIcon />} selected />
<List.ItemLink href="#example-interactive" start={<FileIcon />} title="Launch checklist" meta="Mon" end={<ChevronRightIcon />} />
</List>
</div>
);
}
Numbered
- Install the package.
- Import the stylesheet once.
- Use the components.
import { List, Text } from "@vjdesigns/vjdesigns-ui";
export function Numbered() {
return (
<List variant="numbered" spacing={2}>
<List.Item>Install the package.</List.Item>
<List.Item>Import the stylesheet once.</List.Item>
<List.Item>
<Text as="span">Use the components.</Text>
</List.Item>
</List>
);
}
Accessibility
selected (or current) shows the state with a leading bar as well as a tint, and sets aria-current, so it's announced rather than only seen. List.ItemLink makes each row a single link.
import { FileIcon, FolderIcon, List } from "@vjdesigns/vjdesigns-ui";
export function Accessibility() {
const skip = (event: { preventDefault: () => void }) => event.preventDefault();
return (
<List variant="card" style={{ width: "100%", maxWidth: "24rem" }}>
<List.ItemLink href="#inbox" onClick={skip} selected start={<FolderIcon />} title="Inbox" meta="12 unread" />
<List.ItemLink href="#drafts" onClick={skip} start={<FileIcon />} title="Drafts" meta="3" />
<List.ItemLink href="#archive" onClick={skip} start={<FolderIcon />} title="Archive" />
</List>
);
}
Translated
In Arabic the list mirrors: leading icons and markers sit on the right and trailing details on the left. The text is your own.
- المستندات 12 ملفًا
- الصور 248 صورة
- العقد.pdf آخر تعديل أمس
import {
ChevronRightIcon,
FileIcon,
FolderIcon,
List,
LocaleProvider,
} from "@vjdesigns/vjdesigns-ui";
import ar from "@vjdesigns/vjdesigns-ui/locales/ar";
export function Translated() {
return (
<LocaleProvider locale="ar" messages={ar}>
<List variant="divided" style={{ width: "100%", maxWidth: "24rem" }}>
<List.Item start={<FolderIcon />} title="المستندات" description="12 ملفًا" end={<ChevronRightIcon />} />
<List.Item start={<FolderIcon />} title="الصور" description="248 صورة" end={<ChevronRightIcon />} />
<List.Item start={<FileIcon />} title="العقد.pdf" description="آخر تعديل أمس" />
</List>
</LocaleProvider>
);
}
Usage notes
Every variant draws its own markers, so the browser's markers are removed with CSS; role="list" is added so Safari and VoiceOver keep announcing the list and its item count.
This is a list, not a listbox: items are not selectable options and there is no roving focus. Interactive items (List.ItemButton, List.ItemLink) are ordinary Tab stops. For choosing among options, use a Listbox, Combobox, or Select instead.
Grouping: put a List.Subheader (a real heading by default) before each list and point the list at it with aria-labelledby, so screen readers announce "Account, list, 3 items".
API reference
List
| Prop | Type | Default |
|---|---|---|
variantVisual style. | "plain""bulleted""numbered""divided""card" | "plain" |
asList element. Defaults to | "ul""ol" | — |
orderedShortcut for | boolean | false |
sizeType size, marker size, and item padding. | "sm""md""lg" | "md" |
spacingSpace between items, as a | Space | — |
markerA custom marker for every item, such as | ReactNode | — |
startFor ordered lists: the number of the first item. | number | 1 |
childrenThe items: | ReactNode | — |
refRef to the | Ref<HTMLUListElement | HTMLOListElement> | — |
Also accepts native <ol> attributes, plus className, style and ref.
List.Item
| Prop | Type | Default |
|---|---|---|
startLeading visual: an | ReactNode | — |
titlePrimary text, in bold display type. | ReactNode | — |
descriptionSecondary text under the title, in muted body type. | ReactNode | — |
metaEnd-aligned secondary text, such as a timestamp or a count. | ReactNode | — |
endTrailing content: actions ( | ReactNode | — |
markerOverrides the list's marker for this item. | ReactNode | — |
selectedHighlights the item with a tinted fill and a leading bar (shape plus color). Also sets | boolean | false |
currentSets a specific | "page""step""location""date""time""true" | — |
childrenPlain content. Renders after the title and description, or alone when no slots are used. | ReactNode | — |
Also accepts native <li> attributes, plus className, style and ref.
List.ItemButton
| Prop | Type | Default |
|---|---|---|
disabledDisables the main action. | boolean | false |
classNameClass for the row ( | string | — |
styleStyle for the row ( | CSSProperties | — |
itemPropsExtra props for the row | Omit<ComponentPropsWithRef<"li">, "children"> | — |
startLeading visual: an | ReactNode | — |
titlePrimary text, in bold display type. | ReactNode | — |
descriptionSecondary text under the title, in muted body type. | ReactNode | — |
metaEnd-aligned secondary text, such as a timestamp or a count. | ReactNode | — |
endTrailing content: actions ( | ReactNode | — |
markerOverrides the list's marker for this item. | ReactNode | — |
selectedHighlights the item with a tinted fill and a leading bar (shape plus color). Also sets | boolean | false |
currentSets a specific | "page""step""location""date""time""true" | — |
childrenPlain content. Renders after the title and description, or alone when no slots are used. | ReactNode | — |
Also accepts native <button> attributes, plus className, style and ref.
List.ItemLink
| Prop | Type | Default |
|---|---|---|
disabledDisables the main action. | boolean | false |
classNameClass for the row ( | string | — |
styleStyle for the row ( | CSSProperties | — |
itemPropsExtra props for the row | Omit<ComponentPropsWithRef<"li">, "children"> | — |
startLeading visual: an | ReactNode | — |
titlePrimary text, in bold display type. | ReactNode | — |
descriptionSecondary text under the title, in muted body type. | ReactNode | — |
metaEnd-aligned secondary text, such as a timestamp or a count. | ReactNode | — |
endTrailing content: actions ( | ReactNode | — |
markerOverrides the list's marker for this item. | ReactNode | — |
selectedHighlights the item with a tinted fill and a leading bar (shape plus color). Also sets | boolean | false |
currentSets a specific | "page""step""location""date""time""true" | — |
childrenPlain content. Renders after the title and description, or alone when no slots are used. | ReactNode | — |
Also accepts native <a> attributes, plus className, style and ref.
List.Subheader
| Prop | Type | Default |
|---|---|---|
asElement to render. A heading (default | "h2""h3""h4""h5""h6""div" | "h3" |
sizeType size, matching the list's | "sm""md""lg" | "md" |
childrenThe group label. | ReactNode | — |
Also accepts native <h3> attributes, plus className, style and ref.
See what changed in each version in the Changelog.
Accessibility report
List targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.
axe-core audit (live)
Checking the examples above…
Lighthouse audit
Light mode
Score 10035 passed · 0 failed · 30 not applicable · 10 to check by hand
Dark mode
Score 10035 passed · 0 failed · 30 not applicable · 10 to check by hand
Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.
Built-in behavior
Keyboard
| Key | Action |
|---|---|
| Tab | Moves through interactive items (ListItemButton, ListItemLink); plain items aren't tab stops. |
Roles and states
| Element | Role | States and properties |
|---|---|---|
<ul> / <ol> | list | — |
| Item | listitem | — |
ListItemButton / ListItemLink | button / link | aria-current when selected, aria-describedby → secondary text |
Manual checks
Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.
| Check | What to test | WCAG 2.2 |
|---|---|---|
| Keyboard | Every action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck. | 2.1.1 (A), 2.1.2 (A) |
| Focus | Focus moves in a logical order, is always visible, and isn't hidden behind sticky headers. | 2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA) |
| Screen readers | Names, roles and states are announced correctly, and status changes are announced without moving focus. | 1.3.1 (A), 4.1.2 (A), 4.1.3 (AA) |
| Color | Meaning never depends on color alone; your own colors meet contrast in both modes. | 1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA) |
| Zoom and reflow | At 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed. | 1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA) |
| Pointer targets | Click and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap. | 2.5.8 (AA), 2.5.5 (AAA) |
| Motion | Animations respect the reduced-motion setting. | 2.3.3 (AAA) |