ProgressCircle
Since 0.1.0-alpha.22Progress as a ring, for a compact status such as on a card or a tile: the value in its middle and the label under it. Without a Value it's indeterminate (an arc that turns). Rendered on the server, so it works on static pages; on interactive pages, update Value from C#.
Value and label
Set Value, out of Max (100 by default), and name the ring with Label, which goes under it. To show the value in the middle, set ShowValue, or ValueText for text of your own.
Static
Preview
Code
<Row Gap="6" Wrap Justify="Justify.Center">
<ProgressCircle Value="64" Label="Storage" ShowValue />
<ProgressCircle Value="7" Max="12" Label="Tasks done" ValueText="7/12" />
</Row>Add this example to a page with the izzy CLI:
izzy add component ProgressCircle --at <file>:<line>The ring fills clockwise from the top.
Sizes and colors
Size sets the diameter: 2rem, 3rem or 5rem. To change the ring's color, set Accent.
Static
Preview
Code
<Stack Gap="6">
<Row Gap="6" Wrap>
<ProgressCircle Value="64" Size="ControlSize.Lg" Label="Storage" ValueText="64%" />
<ProgressCircle Value="7" Max="12" Size="ControlSize.Lg" Accent="Accent.From(Color.Success)" Label="Tasks done" ValueText="7/12" />
<ProgressCircle Value="80" Size="ControlSize.Lg" Label="Profile" ShowValue />
</Row>
<Row Gap="6" Wrap>
<ProgressCircle Value="45" Size="ControlSize.Sm" Label="Sync" ShowValue />
<ProgressCircle Value="45" Label="Upload" ShowValue />
<ProgressCircle Label="Indexing" />
</Row>
</Stack>At Sm, the value goes beside the label. For any other diameter, set Width.
Without a Value, an arc turns around the ring.
Mode support
| Feature | Static | Interactive |
|---|---|---|
| Everything | Yes | Yes |
Static: static server-side rendering, with no circuit and no WebAssembly. Interactive: Server, WebAssembly or Auto.
Accessibility
- It renders
role="progressbar"witharia-valuenow,aria-valueminandaria-valuemax; screen readers hearValueTextor the percentage. Labelis its accessible name (througharia-labelledby); without one, anaria-labelon the component names it.- Without a
Valueit has no value attributes, which marks it as indeterminate. - With reduced motion, the indeterminate arc turns more slowly.
Parameters
| Prop | Type | Default |
|---|---|---|
SizeThe diameter: 2rem, 3rem or 5rem. | ControlSize | ControlSize.Md |
ValueHow far along, from 0 to Max. | double? | |
MaxThe value that means done. | double | 100 |
LabelA label above a bar or under a circle, also its accessible name. | string? | |
ShowValueShows the percentage: above a bar, at the end, or in the middle of a circle. | bool | false |
ValueTextText for the value in place of a percentage, such as "3 of 5 files". | string? | |
AccentThe color, such as Accent.Danger, Accent.From(Color.Success) or Accent.Of("#0d9488"). | Accent? | computed |
Plus 17 item props and 4 common props.
Full APISee also
- Progress: shows a progress bar, with or without a known value.
- Spinner: shows a loading ring sized like an icon.
- Gauge: shows one value against its range, such as progress toward a goal.