Progress Bar shows the amount of completion of a task or process. The progress can be determinate or indeterminate. Use Progress Bar to show an ongoing process that takes a noticeable time to finish.
Global loading indicatorA global loading indicator shows at the top of the viewport while processing a server request, after a configurable delay. You don’t need to provide an explicit Progress Bar for these situations.
Use a determinate Progress Bar when progress can be computed.
<div> <vaadin-progress-bar value="0.5"></vaadin-progress-bar> </div>
Use an indeterminate Progress Bar to show that progress is ongoing but can’t be computed.
<div> <vaadin-progress-bar indeterminate></vaadin-progress-bar> </div>
The progress value defaults to a range from 0 to 1, with an initial value of 0. These can be changed to any numeric values:
<div> <vaadin-progress-bar min="0" max="100" value="50"></vaadin-progress-bar> </div>
Progress Bar comes with three theme variants: contrast, success, and error.
<vaadin-progress-bar value="0.5" theme="contrast"></vaadin-progress-bar> <vaadin-progress-bar value="0.75" theme="success"></vaadin-progress-bar> <vaadin-progress-bar value="0.2" theme="error"></vaadin-progress-bar>
|Variant||Theme name||Usage recommendations|
* When progress is satisfactory and/or nearing completion
* Visual preference
* When progress is unsatisfactory
* Draw the user’s attention to a stalled or failed process
* Visual preference
Use labels to give context to a Progress Bar. Labels can also show the progress of a determinate progress bar in text in addition to a graphical representation, for example the percentage of completion, or the number of items processed.
<vaadin-horizontal-layout style="justify-content: space-between;"> <label class="text-secondary" id="pblabel">Processing Financials.xlsx</label> <span class="text-secondary">50%</span> </vaadin-horizontal-layout> <vaadin-progress-bar aria-labelledby="pblabel" value="0.5"></vaadin-progress-bar>
Switch from indeterminate to determinate if the progress becomes computable, and similarly from determinate to indeterminate if it becomes non-computable.
Provide estimates when possible. If a process takes approximately 20 minutes, communicate that to the user.
<div> <label class="text-secondary" id="pblbl">Generating report...</label> <vaadin-progress-bar indeterminate aria-labelledby="pblbl" aria-describedby="sublbl" ></vaadin-progress-bar> <span class="text-secondary text-xs" id="sublbl"> Process can take upwards of 10 minutes </span> </div>
If the user is waiting for a process to finish, consider using a Notification to notify them upon its completion and/or failure. This is useful if the processing takes place “off-screen” or the user is doing other work while waiting.
Avoid blocking processesUse asynchronous processes whenever possible so as not to block the user from completing other tasks while waiting for the process to finish.
If a backend process takes longer than 1 second, use a Progress Bar to show the user that something is happening, especially if it blocks the user’s workflow.
A Progress Bar’s location in the UI implies its scope and whether the surrounding UI is operable during its progression.
For example, a Vaadin application’s built-in loading indicator is placed at the top of the viewport to show that it affects the entire application. The UI is not operable during pending server requests.
Placing a Progress Bar in a dialog, details panel or an otherwise defined section implies that the process displayed is specific to that section. Depending on the use case, the user may or may not be able to interact with the UI.
Component for uploading files.