Progress
Progress bar or ring, indeterminate or filling to a value, with an optional label and count.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
value | number | undefined | undefined | Progress between 0 and max. Leave unset for an indeterminate bar. |
variant | ProgressVariant | linear | linear draws a bar, circular a ring with the value in its middle. |
max | number | 100 | Value that fills the whole track. |
label | string | — | Accessible name when nothing is slotted. Defaults to "Loading". |
show-value | boolean | false | Show the completed percentage beside the label. Always on when the value slot has content. |
Slots
| Name | Description |
|---|---|
(default) | Label shown above the track (e.g. "Uploading files"). Also used as the accessible name. |
value | Replaces the percentage shown next to the label, for counts such as "3 of 5" or "1.2 of 4 MB". |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
header | Row containing the label and displayed value. |
label | Container for the default label slot. |
value | Text region containing the custom value slot or displayed-percentage fallback. |
track | The full progress track (the ring's box in the circular variant). |
indicator | The filled portion of the progress track (the arc in the circular variant). |
unit | The % sign of the percentage in the middle of a circular ring. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-progress--height | pixel | 8px | Thickness of the track and the indicator (the ring's stroke in circular). |
--c2-progress--size | pixel | 64px | Diameter of the circular ring. |
--c2-progress--width | pixel | 100% | Width of the bar; the host is a block by default. |
--c2-progress--border-radius | border-radius | 999px | Rounding of both the track and the indicator. |
--c2-progress--animation-duration | time | 1.4s | One indeterminate cycle; the determinate fill takes half of it. |
--c2-progress--gap | pixel | 8px | Space between the label row and the track. |
--c2-progress__track--background-color | color | #e4e4e7 | Colour of the unfilled track. |
--c2-progress__indicator--background-color | color | #0265dc | Colour of the filled part. |
--c2-progress__indicator--stroke-linecap | string | round | Ends of the circular arc: round or butt. |
--c2-progress__label--color | color | #71717a | |
--c2-progress__label--font-size | font-size | 14px | |
--c2-progress__label--font-weight | font-weight | — | |
--c2-progress__value--color | color | #18181b | |
--c2-progress__value--font-size | font-size | 14px | |
--c2-progress__value--font-weight | font-weight | 500 | |
--c2-progress__ring-value--font-size | font-size | 16px | Size of the value in the middle of a circular ring. |