Reference
DescriptionList
Terms and what they are (<dl>): a column of pairs, or .grid, each term beside its value.
DescriptionList(grid: Bool) { … }
Since 6.2.0
- Service
- checkout-api
- Region
- eu-west-1
- Replicas
- 3
- Status
- Live
- Last deploy
Example
DescriptionList.grid {
DescriptionList.Item("Service", value: "checkout-api")
DescriptionList.Item("Region", value: "eu-west-1")
DescriptionList.Item("Replicas", value: 3)
DescriptionList.Item("Status") { Badge("Live").success }
DescriptionList.Item("Last deploy") { RelativeTime(@2026-11-14T16:05Z) }
}
Stacked: each term above its value
DescriptionList {
DescriptionList.Item("Plan", value: "Pro, billed yearly")
DescriptionList.Item("Renews", value: "1 March 2027")
}
A term and its details written by hand
DescriptionList.grid {
DescriptionList.Term("Owner")
DescriptionList.Details { Link("Platform team", to: "/reference") }
}
Props
| Prop | Type | Unset | Meaning |
|---|---|---|---|
grid: | Bool | false | Each term beside its value, in two columns (the terms as wide as the widest); unset, each term above its value. Written as a flag, |
Attribute families: global, aria, data. Plus the 22 universal props every element takes: animate:, exit:, speed:, duration:, delay:, easing:, stagger:, on:, count:, shared:, class:, ref:, drag:, dragGroup:, dropValue:, dropAxis:, dropInside:, roving:, trapFocus:, mount:, update:, cleanup:.
Flags and cases
A flag is written after the parentheses with a dot: a Bool prop, or a case of one of the element's enum props. A case the enum lacks is an error with a hint.
.grid
Events
Every element also takes the props, the events and the attribute families listed on every element.
Slots
children
Parts
The parts of DescriptionList are written under its name, inside it. Each is described here, with what it takes.
DescriptionList.Item
One pair: its term, and value: or its block.
DescriptionList.Item(_ term: String, value: String or Number or Bool) { … }
| Prop | Type | Unset | Meaning |
|---|---|---|---|
term | String (positional) | — | What it is: the term ( |
value: | String or Number or Bool | the item's block | Its value, shown as text in the |
Drawn for it
What DescriptionList draws itself, by the class a stylesheet can select. They are not written.
| Part | Class | Meaning |
|---|---|---|
DescriptionList.Term | — | A term. |
DescriptionList.Details | — | A value. |
Renders with the class wf-description-list, stable across releases, so a stylesheet may target it.