Progress Bar
A thin bar that shows progress, or moves when there is no number to show.
Usage
tsx
<ProgressBar mode="determinate" value={70} aria-label="upload" />Without a number
The default mode loops, for work you can't measure. It sets no aria-valuenow.
tsx
<ProgressBar aria-label="loading" />Colour
tsx
<ProgressBar mode="determinate" value={62} fill="var(--margo-color-on-main)" />Jumping
Changes slide by default. With animate={false} the bar jumps, which suits a reset to zero.
tsx
<ProgressBar mode="determinate" value={value} animate={false} />Reference
| prop | type | default | |
|---|---|---|---|
as? | ElementType | "div" | the element or component to render |
mode? | "determinate" | "indeterminate" | "indeterminate" | determinate shows value, indeterminate loops |
value? | number | 0 | a percentage, clamped between 0 and 100 |
animate? | boolean | true | false jumps to a new value instead of sliding |
delay? | number | string | — | waits before animating; a number is milliseconds |
fill? | string | the primary gradient | any background: a colour or a gradient |
className? | string | — | added after the component's own class: what you set wins |
…rest | props of as | — | typed against the chosen element |