progress-bar
Use the progress-bar component to visually represent a task or process's current status and progression by indicating how much time or work remains until completion.
Configuration options
Some properties are common to all components, see Common component properties for a list and their configuration options.
value
current - determines the current status to be shown in the bar. This can be dynamically set with an expression, e.g. =$count(@ctx.components.packList.state.selected) max - numeric, set the maximum value of the progress bar, e.g., the sales target is 5 new customers a month, making the max: 5 . You can set the maximum dynamically, e.g., using the datasource =$count(@ctx.datasources.checkbox-list)
color
Sets the color of the progress -bar, choose a color from the provided color palette. Default color is black if the property is not specified in the YAML.
errorText
Add text, string, or expressions to show in text under the progress bar. Text is shown in red to indicate an error with progress.
helperText
Add text, string, or expressions to guide users by showing text under the progress bar, e.g, Monthly target is $4000.
size
Choose from extra-large, large, medium, small, tiny, with large being the default if property is not specified in the YAML.
steps
Numeric with a maximum of 20. Use steps to divide up the bar. By default, the bar is continuous. For example, steps:5 will break down the bar into five equal sections. The higher the number of steps the smaller each bar segment becomes.
style
isDisabled can be set to true or false. If true the progress-bar is disabled.
subtitle
- value- can add text, string or an expression to show as the subtitle, which is visible under the progress-bar.align-center,left, andrightalignment with the default ascenterif the property is not specified in the YAML.color- specify the color the subtitle text by choosing a color from the provided color palette.position- place the subtitle at thebottomortop. Thetopis the default if the property is not specified in the YAML.
title
value- can add text, string or an expression to show as the title, which is visible under the progress-bar.align-center,leftandrightalignment with the default ascenterif the property is not specified in the YAML.color- specify the color for the title text by choosing a color from the provided color palette.position- place the title at thebottomortopof the progress-bar. Thetopis the default if the property is not specified in the YAML.
onPress
Choose from the provided list of available actions, for example, use the go-to action to open a different jig. The action is triggered when the progress-bar is pressed; e.g., navigate to another jig.
Considerations
The title, subtitle, and bar can use a
colorproperty. Ensure the property is added at the correct YAML level for each.The
component.progress-barcan only be used on ajig.default.
Examples and code snippets
Progress bar with title and subtitle
This example shows the different ways the title and subtitle can be configured using position, color and alignment.
Example: See the full example in GitHub.
Progress bar with error and helper text
You can use the helperText property to provide a tip or hint to help users read the progress-bar. Use the errorText to show an error or negative text at the bottom of the progress-bar. In this example, the errorText is used to show that there has been no progress made.
Example: See the full example in GitHub.
Progress bar with colors
In this example we change the color of the bar, break the bar up by using steps and change the thickness of the bar using the size property.
Example: See the full example in GitHub.
Progress bar size
The progress-bar can be sized from a thin (tiny) to extra thick (extra-large) bar using the size property. No color is used in this example so the default color black is used.
Example: See the full example in GitHub.
Progress bar with steps
The progress-bar can be shown as a continuous bar or broken up into segments. Use the step property to determine the number of segments required. The larger the number of steps, the smaller the segments as shown in the bars on the left.
Example: See the full example in GitHub.
Progress bar with onPress
In this example the onPress property uses the action.set-state set to true. When the progress-bar is pressed the state is evaluated in the when property of the component.image, which then shows the image.
Example: See the full example in GitHub.
Dynamic Progress bar
This example shows how the component.progress-bar steps are dynamically updated when the list-item checkbox is selected. The errorText property and the helperText property are dynamically changed using an expression.
Example: See the full example in GitHub.
Last updated
Was this helpful?