ProgressBar · ProgressRing
Controlled progress bars and rings with an indeterminate state.
WebReact NativeProgress
Try it
Preparing the example…
Shortest usage
<ProgressBar value={progress} max={100} />
<ProgressRing value={progress} size={96}>{progress}%</ProgressRing>
<ProgressBar value={null} /> {/* indeterminate */}What it handles for you
- Values clamp to
0…max, andnullshows an indeterminate sweep or a spinning arc. - A new value in the middle of a motion continues with its velocity.
- One continuous line or arc, never segments that jump.
- A spring with
durationends exactly at that time.
Use it for
- A file upload.
- Storage used out of a quota.
- Progress through a checkout.
Props
ProgressBar
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | null | Progress from 0 to max; null is indeterminate. | |
max | number | 100 | The value that means complete. |
color | string | 'currentColor' | Fill color. |
trackColor | string | '#e7ece9' | Track color. |
thickness | number | 8 | Line thickness in pixels. |
direction | 'ltr' | 'rtl' | 'ltr' | Fill from the left (ltr) or from the right (rtl). |
transition | Transition | spring | A timing curve { duration, easing } or a spring { tempo: 'spring', spring }. Springs keep their momentum when interrupted. |
ProgressRing
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | null | Progress from 0 to max; null is indeterminate. | |
max | number | 100 | The value that means complete. |
size | number | 96 | Diameter in pixels. |
thickness | number | 8 | Ring thickness in pixels. |
color | string | 'currentColor' | Arc color. |
trackColor | string | '#e7ece9' | Track color. |
children | ReactNode | A label shown in the middle. | |
transition | Transition | spring | A timing curve { duration, easing } or a spring { tempo: 'spring', spring }. Springs keep their momentum when interrupted. |
Other props go to the rendered element, so className, style and event handlers work as usual.
Web and React Native
ProgressRing takes children for a label in the middle; ProgressBar takes direction to fill from the right.
The same components and props work on React Native.