Reference
List
List of its children; ordered for a numbered list.
List(ordered: Bool) { … }
Before 5.0
-
Unlimited projects
-
Custom domains
-
Priority support
-
wf init shop -
Write your first page
-
wf serve
Example
Stack(gap: .md) {
List {
List.Item { Text("Unlimited projects") }
List.Item { Text("Custom domains") }
List.Item { Text("Priority support").bold }
}
List.ordered {
List.Item { Code("wf init shop") }
List.Item { Text("Write your first page") }
List.Item { Code("wf serve") }
}
}
Drawn from a list
state groceries = ["Milk", "Eggs", "Bread"]
List { for g in groceries by g { List.Item { Text(g) } } }
Props
| Prop | Type | Unset | Meaning |
|---|---|---|---|
ordered: | Bool | false | Numbered: an |
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.
.ordered
Events
Every element also takes the props, the events and the attribute families listed on every element.
Slots
children
Parts
The parts of List are written under its name, inside it. Each is described here, with what it takes.
List.Item
One entry (<li>).
List.Item { … }
Renders with the class wf-list, stable across releases, so a stylesheet may target it.