Data List
Semantic key-value pairs rendered as a native <dl> (definition list). Ideal for displaying record details, settings summaries, or any structured label + value content.
Basic Usage
- Name
- John Doe
- john.doe@mail
- Plan
- Pro ($29/mo)
- Joined
- June 1, 2024
The value can also be passed as value, which reads naturally when it comes straight from a model. It is rendered as text. When an item has both, the slot wins, so use the slot for anything with markup, such as a badge or a link.
- Order
- SO-10482
- Carrier
- Standard shipping
- Delivered
- March 14, 2025
Layouts
Horizontal (default)
Labels on the left, values on the right. Items separated by dividers:
<x-wirekit::data-list layout="horizontal">
<x-wirekit::data-list.item label="Status">Active</x-wirekit::data-list.item>
</x-wirekit::data-list>
Stacked
Labels above values, each item spaced vertically:
- Description
- A long description that wraps naturally in a stacked layout without being constrained by a side-by-side arrangement.
- Category
- Engineering
Grid
Two columns, and one on a screen narrower than 40rem:
- First Name
- John
- Last Name
- Doe
- john.doe@mail
- Phone
- +1 (555) 123-4567
Summary
The totals shape — an invoice subtotal block, a cart summary, an order overview. The label takes whatever width is left over; the value is as wide as its own content and sits flush right, so amounts line up under one another along a single column edge. Values are set in tabular figures, so digits occupy equal widths and the decimal points stack:
- Subtotal
- $1,240.00
- Shipping
- $12.50
- Tax (19%)
- $238.08
- Total
- $1,490.58
Use it wherever a value is a quantity rather than a description. grid cannot express this shape — its two tracks are equal, so the amount is handed half the row and floats in the middle of its own whitespace — and horizontal cannot either, because its label track is a fixed third of the width, so a long label wraps while the center of the row sits empty.
Two deliberate differences from the other three layouts:
- No row separators, and no per-item padding. Row rhythm comes from the grid's row gap instead. A totals block rules the line above the grand total, not every line — add that rule yourself where it belongs.
- A
classon an item has no visual effect. The item's wrapper isdisplay: contentshere, so that its<dt>and<dd>can be the grid's own items. Style the value through the slot content instead.
Detail
The mirror of summary, and the commoner of the two: the label is as wide as its own text and the value takes the rest. This is the ordinary detail list — a customer, a payment method, a shipping option — where the value is a description rather than a quantity:
- Customer
- Dana Ortiz
- Payment method
- Credit card ending 4242
- Shipping
- Standard, 3–5 business days
grid is the tempting wrong choice here. Its two tracks are equal, so a short label like "Shipping" is handed half the row and the value the other half, leaving the two standing apart with the middle of the row empty.
It shares summary's grid mechanics — the items become the list's own grid cells, so the value column is one track measured across every row — and deliberately not its alignment. A summary value is an amount and sits flush right in tabular figures so the digits stack; a detail value is prose, and right-aligning a sentence strands it against the far edge.
Rich Values
The value slot accepts any content, including other WireKit components:
- Status
- Active
- Plan
- Pro
- Next billing
- December 1, 2024
Props
Container
| Prop | Type | Default | Description |
|---|---|---|---|
layout |
string |
'horizontal' |
horizontal | stacked | grid | summary | detail |
scope |
string |
null |
Scoped personalization key |
Item
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
null |
The label (key) for this entry |
value |
string |
null |
The value for this entry, rendered as text when the slot is empty. The slot wins when both are given |
scope |
string |
null |
Scoped personalization key |
Accessibility
- Uses native
<dl>,<dt>,<dd>HTML elements — screen readers announce content as a definition list. - No ARIA attributes needed — the semantic HTML provides the accessibility contract.
- Label text styled with muted color but readable at WCAG AA contrast ratios via design tokens.
Keyboard Interaction
This component is purely presentational and does not respond to keyboard input.
Pitfalls
labelis escaped; the value is not. A<strong>passed to thelabelprop renders as text —{{ $label }}escapes it. The value is the item's default slot, and a slot isHtmlable, so it passes through unescaped: that is what makes the Rich Values example above work. For a rich key, render it in the slot and leavelabelunset.data-list.itemhas no named slots, so there is nothing else to reach for.- Don't reach for
summarywhen the value is prose. It sizes the value track to the content, so a sentence pushes the label into a narrow column.stackedis the layout for long values.
Design Tokens
| Token | Usage |
|---|---|
--font-wk-sans |
Font family |
--text-wk-md |
Body text size |
--text-wk-sm |
Label text size |
--color-wk-text |
Value text color |
--color-wk-text-muted |
Label text color |
--color-wk-border-subtle |
Divider color (horizontal layout) |
--padding-wk-y-sm |
Item vertical padding |
--font-wk-heading-weight |
Label font weight |
--gap-wk-xs |
Row gap (summary and detail layouts) |
--gap-wk-md |
Column gap between label and value (summary and detail layouts) |
--gap-wk-lg |
Gap between rows (stacked, grid) and between label and value (horizontal) |