Reference
Fieldset
Controls that belong together — an address, a choice of plan — under a legend that names them.
Fieldset(legend: String) { … }
Since 6.2.0
legend
,
Example
state street = ""
state city = ""
state postcode = ""
Fieldset(legend: "Shipping address") {
Input(bind: street, label: "Street")
Row(gap: .md) {
Input(bind: city, label: "City")
Input(bind: postcode, label: "Postcode")
}
}
Text("{street}, {postcode} {city}").muted
Props
| Prop | Type | Unset | Meaning |
|---|---|---|---|
legend: | String (required) | — | What the group is: drawn as its |
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.
No flags of its own.
Events
Every element also takes the props, the events and the attribute families listed on every element.
Slots
children
Drawn for it
What Fieldset draws itself, by the class a stylesheet can select. They are not written.
| Part | Class | Meaning |
|---|---|---|
Fieldset.Legend | — | Its legend. |
Renders with the class wf-fieldset, stable across releases, so a stylesheet may target it.