Progress
Progress shows how far along a task is, such as an upload or an export.
Use Progress to show how much of a task is done, such as an upload, an export or a storage quota. Give value a number and the bar fills to that fraction. Set value to null when you cannot say how much is left, and the bar shows a moving segment instead.
For a short wait inside a control, such as a Button that is saving, use a Spinner. When the person sets the value themselves, use a Slider. A Progress bar only reports, so it takes no focus and responds to no pointer.
The bar has one fixed thickness and fills the width of its container, so set the width on the element that holds it. The value runs from 0 to 100 by default, and min and max let you count in other units, such as gigabytes.
The fill uses your app's accent colour. When the person has asked their system for reduced motion, the moving segment slows down but keeps moving, because the movement is what tells them that work is still happening.
Screen readers announce the bar as a progress bar with its current value. Name it with aria-label, or point aria-labelledby at a visible Text. When a percentage alone does not say enough, use getAriaValueText to provide words such as “7.2 of 10 gigabytes used”.
- Spinner when you do not know how long it will take.
Props
Generated from the types. It lists what this component DECLARES: a prop that arrives from a shared type or from the platform is real and is not repeated here.
| Prop | Type | What it does |
|---|---|---|
aria-label? | string | The accessible name of the task, such as "Uploading photos". |
className? | string | Your classes, appended to the ones this component resolves rather than replacing them. |
size— A bar has one designed thickness, and its length always comes from its container. Set the width on the element that holds it.tone— The fill always uses the accent colour. Whether a bar should turn red for a failed upload is still an open design question, so the prop is left out rather than guessed.