React Reference ยท Built-in DOM Components
The React progress element
Reference for the React progress element: show determinate progress with value and max, go indeterminate by omitting value, and label it for screen readers.
<progress> is the native progress bar. With a value, it shows how far along a task is. Without a value, it is indeterminate: the browser shows a moving or striped bar meaning "working, no idea how long". Browsers draw it for you, support keyboard and screen-reader semantics, and let you restyle it with CSS (using vendor pseudo-elements).
React treats <progress> like any other element, but there is one practical detail: value is a plain attribute, not an input-like controlled prop. Pass a number from state and React updates the bar when it changes. No onChange is needed because the user cannot edit it.
<progress value={30} max={100} aria-label="Upload progress" />
Try it
Syntax
<progress value={number} max={number} />
| Name | Description |
|---|---|
value |
Current progress, between 0 and max. Omit it (pass undefined) for an indeterminate bar. |
max |
The value that means "complete". Default is 1. Must be greater than 0. |
children |
Fallback text for very old browsers. Modern browsers ignore it, but it is harmless and can be a nice text label. |
Returns: an HTMLProgressElement. Its position property is value / max for a determinate bar and -1 for an indeterminate one.
Edge cases: a value above max is clamped to max by the DOM. undefined and null both leave out the attribute, so the bar is indeterminate.
Usage notes
- Default
maxis 1.value={0.3}is 30 percent. If you use percentages, setmax={100}sovalue={30}means 30 percent. - Indeterminate means no
valueattribute. Settingvalue={0}shows an empty bar, not a spinner. - Label it. A bar without a name is not useful to assistive technology. Use
aria-label,aria-labelledby, or wrap it in a<label>. - Do not confuse with
<meter>.<progress>is for a task moving toward completion.<meter>is a gauge for a known range (disk usage, a score). - Announce changes sparingly. Progress bars are not live regions. For long tasks, also update a text status with
role="status", and do not update it on every percent. - Styling. Browser-specific selectors (
::-webkit-progress-bar,::-webkit-progress-value,::-moz-progress-bar) change the look. Setappearance: nonefirst. Check each browser. - Smooth animation. Updating
valuein small steps looks jumpy. A CSStransitionis not applied consistently to native progress bars, so for animated effects some teams use adivwithrole="progressbar"andaria-valuenow. - Updates are cheap. Changing
valuetouches one attribute, but state at a high frequency (many times per second) re-renders the component, so throttle upload events.