Reference
Row
Horizontal flex layout. It stays a row at every width unless .stacks or a responsive direction says otherwise.
Row(gap: Enum, align: Enum, justify: Enum, …) { … }
Before 5.0
gap
align
justify
direction
row
column
Ada Lovelace
Owner
Example
Row(gap: .md, align: .center, justify: .between) {
style { padding: 0.75rem 1rem; border: 1px solid $color-border; border-radius: $radius-md }
Row(gap: .sm, align: .center) {
Avatar(initials: "AL").primary
Stack(gap: .xs) {
Text("Ada Lovelace").bold
Text("Owner").muted.sm
}
}
Badge("Active").success
Button("Manage").sm
}
A column on a narrow screen
Row(gap: .md).stacks {
Card { Card.Body { Text("Plan: Pro") } }
Card { Card.Body { Text("Seats: 12") } }
Card { Card.Body { Text("Renews: March 14") } }
}
A direction per breakpoint
Row(direction: { base: .column, md: .row }, gap: .sm) {
Button("Save draft")
Button("Publish").primary
}
Spread evenly
Row(justify: .evenly) {
Text("Mon") Text("Tue") Text("Wed") Text("Thu") Text("Fri")
}
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 the row (vertically) (
|
justify: | one of its cases | start | How its children share the free space along the row (
|
direction: | one of its cases | row | Which way its children run (
|
stacks: | Bool | false | Below 768px it turns into a column ( |
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
.row
.column
.stacks
Events
Every element also takes the props, the events and the attribute families listed on every element.
Slots
children
Renders with the class wf-row, stable across releases, so a stylesheet may target it.