Numbered List
as="ol" makes the sequence real and draws the numbers.
<List as="ol">
<List.Item>Create your account</List.Item>
<List.Item>Configure your settings</List.Item>
<List.Item>Start building</List.Item>
</List>Stacks items down the page with bullets, numbers or icons, or as interactive 32px rows.
<List>
<List.Item>First item</List.Item>
<List.Item>Second item</List.Item>
<List.Item>Third item</List.Item>
</List>pnpm add @usefragments/uiImport styles once from @usefragments/ui/styles. See the installation guide for framework and theme setup.
Import List once, then compose its parts with dot notation.
List.ItemList.RowThe default marker — reach for it when order does not matter.
<List>
<List.Item>First item</List.Item>
<List.Item>Second item</List.Item>
<List.Item>Third item</List.Item>
</List>as="ol" makes the sequence real and draws the numbers.
<List as="ol">
<List.Item>Create your account</List.Item>
<List.Item>Configure your settings</List.Item>
<List.Item>Start building</List.Item>
</List>Each item takes its own glyph in the marker column, in ink 3.
<List marker="icon">
<List.Item icon={<Check weight="bold" />}>Unlimited projects</List.Item>
<List.Item icon={<Check weight="bold" />}>Priority support</List.Item>
<List.Item icon={<Check weight="bold" />}>Advanced analytics</List.Item>
</List>Interactive 32px rows: a leading glyph, the label, trailing meta, the current row marked.
import { House, Gear, CreditCard } from "@phosphor-icons/react";
<List marker="none" gap="none" aria-label="Pages">
<List.Row icon={<House />} meta="/" selected>
Home
</List.Row>Navigation rows render links through `render`.
<List marker="none" gap="none" aria-label="Docs">
<List.Row render={<a href="/docs/start" />} aria-current="page" selected>
Getting started
</List.Row>
<List.Row render={<a href="/docs/theming" />}>Theming</List.Row>
</List>No markers: a plain stack of items.
<List marker="none">
<List.Item>Dashboard</List.Item>
<List.Item>Settings</List.Item>
<List.Item>Profile</List.Item>
</List>Prop | Type | Default | Description |
|---|---|---|---|
as | "ol" | "ul" | undefinedolul | ul | List element. An ol numbers its items; a ul draws a bullet. |
childrenRequired | React.ReactNode | Not set | List.Item or List.Row components |
gap | ListGap | undefinedxssmnone | sm | Space between items: 0, 4 or 8 |
Item.childrenRequired | React.ReactNode | Not set | — |
Item.icon | React.ReactNode | Not set | Leading glyph, drawn in the marker column in place of the marker. |
marker | ListMarker | undefinednoneicondisc | Not set | Marker before each item, when it is not the default for `as` |
Row.childrenRequired | React.ReactNode | Not set | The row's label. Truncates to one line. |
Row.icon | React.ReactNode | Not set | Leading glyph: ink 3 at rest, ink 1 on the selected row. |
Row.meta | React.ReactNode | Not set | Trailing detail (a count, a path, a time), in ink 3 at the label size. |
Row.render | useRender.RenderProp<Record<string, unknown>> | undefined | Not set | Replace the button with another element, such as a link. Accepts an element or a function that returns one. |
Row.selected | boolean | undefined | Not set | The row you are on: the neutral current fill and ink 1. Sets `aria-current` unless you pass `aria-current` or `aria-pressed` yourself; a row with `aria-pressed` is a toggled choice and takes the selection wash and ring. |
style | CSSProperties | undefined | Not set | — |