List
A styled list component with consistent spacing and design tokens. Supports unordered, ordered, and unstyled lists.
Unordered List
- First item
- Second item
- Third item
Ordered List
- Install the package
- Run the installer
- Add the Blade directive
No Markers
- Clean item one
- Clean item two
- Clean item three
Long Lists From Data
Every list.item, link and text is a component of its own, and a component costs a render: a list of a thousand rows, each with a link and a note, renders three thousand of them. Pass the rows as data with items and the list draws them all in its own render. A row is its text, or an array with the text, the href it links to and a short meta note after it, set small and muted:
- Shipping rules for the winter season Updated today
- Returns within thirty days Since March
- A row that is only its text
// In the component that renders the page: the rows as data, built once
$rows = $articles->map(fn (Article $article): array => [
'text' => $article->title,
'href' => route('articles.show', $article),
'meta' => $article->updated_at->diffForHumans(),
])->all();
The link and the note carry exactly the classes link and text render with, your personalization of those two included. An href the browser would run as script, javascript: and the like, leaves its row as text. Rows from items come first, and anything in the slot follows them. For a row that needs more than a text, a link and a note, write a list.item for it.
Spacing
- Item with more space
- Between each item
- For better readability
Roman & Alpha Markers
For multi-level legal / academic / spec-style numbering, four additional type values are available — lower-roman (i, ii, iii), upper-roman (I, II, III), lower-alpha (a, b, c), upper-alpha (A, B, C). All four render as <ol> (ordered list semantics).
- Preamble
- Recitals
- Operative provisions
- Personal data
- Account credentials
- Usage telemetry
Nested Lists — Worst-Case (mixed marker types, 5 levels)
Lists nest by composition — drop another <x-wirekit:: inside a <x-wirekit::. Mix type values per level for legal / spec / outline-style hierarchies. The example below combines all five marker styles across five depth levels, replicating the "1 → a → i → ●" pattern common in legal contracts and standards documents:
- Top-level numbered section
- Capital-letter sub-section
- Lower-roman clause
- Lower-letter sub-clause
- Bullet detail one
- Bullet detail two
- Another lower-letter sub-clause
- Lower-letter sub-clause
- Second lower-roman clause
- Lower-roman clause
- Second capital-letter sub-section
- Capital-letter sub-section
- Second top-level section (no nesting)
- Third top-level section
- Major roman point
- Another major roman point
Each level is a fresh <x-wirekit:: — markers, spacing, and the underlying tag (<ol> / <ul>) all resolve from the inner component's own type prop. Markdown's flat list-syntax can't express this; pure <x-wirekit:: composition can.
Props — List
| Prop | Type | Default | Description |
|---|---|---|---|
type |
string | 'disc' |
Marker type: disc, decimal, none, lower-roman, upper-roman, lower-alpha, upper-alpha |
spacing |
string | 'sm' |
Item spacing: none, sm, md |
as |
string|null | null |
Override element (auto: ul for disc / none, ol for ordered types) |
items |
array|Collection|null | null |
Rows as data, drawn in one render: a string, or an array with text, href and meta. See Long Lists From Data |
scope |
string|null | null |
Scoped personalization name |
Props — List Item
| Prop | Type | Default | Description |
|---|---|---|---|
scope |
string|null | null |
Scoped personalization name |
Keyboard Interaction
This component is purely presentational and does not respond to keyboard input.
Pitfalls
- Don't use a list for layout. Reach for
<x-wirekit::orstack> <x-wirekit::. Lists carry semantic role="list" and screen readers announce item count — misleading for non-list content.row>
Design Tokens
The list and list-item primitives are layout wrappers — they apply structural classes (spacing utilities, semantic <ul> / <ol> / <li> elements) without referencing color or sizing tokens directly. Item content (icons, badges, links) inherits its tokens from the surrounding Text, Icon component, and Link component.