HTML Progress Bar and Meter Generator
WM-59Write a label and a value and get a progress bar for work in progress, or a meter gauge for a measurement within a range.
Runs in your browser. Nothing is uploaded.
Attribute lines: label:, value:, max:, id: (meter also min:, low:, high:, optimum:)
HTML
How to use it
- Write label:, value: and max: lines (and id: if you want one).
- Click Progress bar for a task under way, or Meter gauge for a measurement.
- For a meter, add min:, low:, high: and optimum: lines.
- Copy the HTML into your page.
Progress or meter
Use progress for a task that moves toward completion, such as an upload or a form with several steps. Use meter for a measurement within a known range, such as disk usage or a score. The test is whether the value is expected to keep going up to full: that is progress. A meter never means done. Using the wrong one changes how assistive technology describes it. Both are labelable, so a label with for and id gives the bar its accessible name, and the tool writes that for you.
Progress values and indeterminate bars
Progress takes value and max, with value between 0 and max. The tool sets max to 100 when you leave it out, which differs from the browser default of 1. If you leave the value line out entirely, the element is indeterminate: the browser shows a busy bar for work of unknown length. The text inside is a rounded percentage, there for browsers that cannot draw the element. The bar does not move on its own, so your script has to update the value attribute.
Meter ranges and the optimum
Meter takes min, max, low, high and optimum. Low and high split the range into three zones, and optimum says which zone is best, so the browser can colour a bar green, yellow or red. The tool checks that value, low, high and optimum all lie between min and max and that low does not exceed high. Min defaults to 0 and max to 1 here, as in the standard, so give a max line for percentages.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
Missing label. Add a line such as "label: Upload progress"; a progress bar needs a name. | The progress input has no label: line. | Add label: and the name of what is progressing. |
Missing value. A meter shows a measurement, so add a line such as "value: 70". | The meter input has no value: line. | Add value: and the measured number. |
Questions people ask
What is the difference between progress and meter?
progress shows how far a task has got toward done. meter shows a measurement within a known range, like disk space used. A meter does not mean a task is finishing.
How do I make an indeterminate progress bar?
Leave out the value attribute. The browser shows a bar that signals activity without a percentage. Leave out the value: line in this tool. The bar shows a busy animation that browsers draw in their own way. Set the value later in script once the real amount is known.
How do I update a progress bar from JavaScript?
Set the value property on the element, for example bar.value = 40. The element does not animate on its own. You can also use setAttribute. Keep the value between 0 and max, and update the nearby text if you show a number.
What do low, high and optimum do on a meter?
They split the range into zones and mark the preferred zone, so the browser can change the colour of the bar when the value is in a poor zone.
Does a progress bar need a label?
Yes, an accessible name is needed. Use a label linked by for and id, which this tool writes, or aria-label. Without one, a screen reader announces a progress bar with no name, which tells the user nothing about what is progressing.
About this tool
The progress action builds a progress element for a task that is under way: value must be from 0 to max, max defaults to 100 here, and leaving out the value line gives an indeterminate bar for work of unknown length. The text inside the element is the rounded percentage. The meter action builds a gauge for a known measurement inside a range, such as disk usage; value, low, high and optimum must lie between min (default 0) and max (default 1), and low cannot exceed high. The label is linked with for and id. Neither element animates by itself; your page updates the value.