Reference

Container

Centred wrapper with a maximum width and horizontal padding.

Container(fluid: Bool) { … }

Before 5.0

Release notes

Version 7.0 makes the compiler strict: what 6.x accepted and 7.0 refuses is an error with its fix.

Compiler Breaking

Example

wf

Container { style { background: $color-surface; border: 1px dashed $color-border; padding: 1rem } Heading("Release notes").h3 Text("Version 7.0 makes the compiler strict: what 6.x accepted and 7.0 refuses is an error with its fix.").muted Row(gap: .sm) { Badge("Compiler").primary Badge("Breaking").warning } }

Full width, with no maximum

wf

Container.fluid { style { background: $color-surface; padding: 1rem } Text("This band runs edge to edge of whatever holds it.") }

A page's main column

wf

Container { Heading("Settings").h3 Text("Changes are saved as you make them.").muted }

Props

Props of Container
PropTypeUnsetMeaning

fluid:

Bool

false

Drops the 1200px maximum width, so it spans its parent; the side padding stays. Written as a flag, .fluid, or fluid: 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.

.fluid

Events

Every element also takes the props, the events and the attribute families listed on every element.

Slots

children

Renders with the class wf-container, stable across releases, so a stylesheet may target it.