Reference

List

List of its children; ordered for a numbered list.

List(ordered: Bool) { … }

Before 5.0

  • Unlimited projects

  • Custom domains

  • Priority support

  1. wf init shop
  2. Write your first page

  3. wf serve

Example

wf

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

wf

state groceries = ["Milk", "Eggs", "Bread"] List { for g in groceries by g { List.Item { Text(g) } } }

Props

Props of List
PropTypeUnsetMeaning

ordered:

Bool

false

Numbered: an <ol> whose items are counted 1., 2. …; unset, a <ul> with no markers. Written as a flag, .ordered, or ordered: true.

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.