Reference
CircularProgress
A ring that fills to value: of max:, announced as a progress bar; with no value:, it turns, for work of no known length. Its block is drawn in the middle.
CircularProgress(value: Number, max: Number, label: String) { … }
Since 6.2.0
max
label
40%
Uploading photos.zip
Example
state done = 40
Row(gap: .lg, align: .center) {
CircularProgress(value: done, max: 100, label: "Upload") { Text("{done}%").sm }
Stack(gap: .xs) {
Text("Uploading photos.zip").bold
Button("Add 20%").sm { on click { done = if done >= 80 { 100 } else { done + 20 } } }
}
}
Turning, with no value
CircularProgress(label: "Loading the report")
Props
| Prop | Type | Unset | Meaning |
|---|---|---|---|
value: | Number | none: it turns | How far along, out of |
max: | Number | 100 | The value at which the ring is full; |
label: | String | none | What is progressing: the progress bar's accessible name ( |
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
Renders with the class wf-circular-progress, stable across releases, so a stylesheet may target it.