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

wf

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

wf

Stack(gap: .xs, align: .center) { Avatar(initials: "GH").lg.primary Text("Grace Hopper").bold Text("Admiral").muted.sm }

Spread to fill its height

wf

Stack(justify: .between) { style { height: 12rem; border: 1px dashed $color-border; padding: 0.5rem } Text("Top") Text("Bottom") }

Props

Props of Stack
PropTypeUnsetMeaning

gap:

one of its cases

md

Space between its children, from the theme's spacing scale (wf-gap--*, gap:); a flag (.lg) or a value per breakpoint ({ base: .sm, lg: .lg }). Written as a flag, .xs, or by name, gap: .xs.

  • .xs: Extra small: $spacing-xs, 0.25rem
  • .sm: Small: $spacing-sm, 0.5rem
  • .md (the default): Medium: $spacing-md, 1rem (the default)
  • .lg: Large: $spacing-lg, 1.5rem
  • .xl: Extra large: $spacing-xl, 1.5–2rem, growing with the screen

align:

one of its cases

stretch (the CSS default)

Where its children sit across it (horizontally): .stretch makes each child full width (align-items); a flag for .stretch/.baseline, or a value per breakpoint. Written as a flag, .start, or by name, align: .start.

  • .start: align-items: flex-start
  • .center: align-items: center
  • .end: align-items: flex-end
  • .stretch (the default): align-items: stretch: each child fills that axis
  • .baseline: align-items: baseline: text baselines line up

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 (justify-content); a flag for .between/.around/.evenly, or a value per breakpoint. Written as a flag, .start, or by name, justify: .start.

  • .start (the default): justify-content: flex-start: packed at the start
  • .center: justify-content: center
  • .end: justify-content: flex-end: packed at the end
  • .between: justify-content: space-between: the first and last at the edges
  • .around: justify-content: space-around: equal space around each
  • .evenly: justify-content: space-evenly: equal space everywhere

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.