Reference
Stack
Vertical flex layout.
Stack(gap: Enum, align: Enum, justify: Enum) { … }
Before 5.0
gap
align
justify
Sign in
Use the address you signed up with.
Example
Stack(gap: .md) {
style { max-width: 22rem; padding: 1rem; border: 1px solid $color-border; border-radius: $radius-md }
Heading("Sign in").h3
Text("Use the address you signed up with.").muted
Button("Continue with email").primary.full
Button("Continue with a passkey").full
}
Centred, tight
Stack(gap: .xs, align: .center) {
Avatar(initials: "GH").lg.primary
Text("Grace Hopper").bold
Text("Admiral").muted.sm
}
Spread to fill its height
Stack(justify: .between) {
style { height: 12rem; border: 1px dashed $color-border; padding: 0.5rem }
Text("Top")
Text("Bottom")
}
Props
| Prop | Type | Unset | Meaning |
|---|---|---|---|
gap: | one of its cases | md | Space between its children, from the theme's spacing scale (
|
align: | one of its cases | stretch (the CSS default) | Where its children sit across it (horizontally):
|
justify: | one of its cases | start | How its children share the free space down the column, seen only when it is taller than its children (
|
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.
.xs
.sm
.md
.lg
.xl
.stretch
.baseline
.between
.around
.evenly
Events
Every element also takes the props, the events and the attribute families listed on every element.
Slots
children
Renders with the class wf-stack, stable across releases, so a stylesheet may target it.