Circle progress
What is Circle progress?
Circle Progress component is a visual element used to display progress or completion status in a circular format. It is often used to represent the progress of tasks, projects, or any other measurable value.
Properties
Properties | Description |
---|---|
Value | the percentage value represents the progress |
Hide value label | whether the value label is hidden |
Tooltip | Users can enter the component tooltip here. The tooltip will be shown when it is focused. Markdown format is supported. |
Hidden | Dynamically control whether the component is hidden. You can change the hidden status through a dynamical boolean value. |
Alignment | Set the alignment (align to left or right) of the label |
Theme Color | Allows users to specify the button's background color and opacity |
Styles | the stroke width of the circle represents the progress |
Method
You can use other components to control the component. We support the following two methods:
- setValue
To set the text area input value, for example, {{"value1"}}
Properties | Description |
---|---|
Value | Input value |
- clearValue
To clear the value of the selected component
Data
The component has some commonly used data, which can be called via {{componentName.propertyName}}
in the app.
Property name | Description |
---|---|
alignment | control the position of the progress circle |
color | color of the circle |
displayName | the name of this component (ie button1) |
hidden | hidden status (true or false) |
strokeWidth | width of the circle stroke |
tooltipText | value of tooltip text |
trailColor | color of the trail or the unfilled portion of the circle progress |
value | percentage value of the progress |
Example: {{circleProgress1.value}}
Use case
We will demonstrate how to make a form with a circle progress component showing the completion progress of the form.
Step 1 Add Components
Add a form
component with the default text "Form" and a "Submit" button to Canvas.
Add an input
component, a number input
component, and a circle progress
component from **Insert**
into the form.
Label the input component to be "Name", the number input component to be "Age" and the bar progress component to be "Progress".
Set the placeholder of the input component to "Please put your name here" and the default value of the number input to 0 as shown below.
Step 2 Configure the component
For the input
and number input
components, we can configure them to set the value in circle progress
component to reflect the progress of completion.
- Click the
input
andnumber input
component to open its inspect page. UnderEvent handler
, click**+ New**
. - In the Edit event handler, select
Control component
in action, and select thecircle progress
component that you want to update as the target of the event. - Choose the
setValue
action and set the value as
{
{
input1.value && numberInput1.value
? "100"
: input1.value || numberInput1.value
? "50"
: "0";
}
}
Note: need to set the event handler as described above to BOTH input and number input components.
For the "Submit" button
component, we can configure it to submit the form if the form is completed (ie circle progress 100%)
- Click the
button
component to open its inspect page. UnderEvent handler
, click**+ New**
. - In the Edit event handler, select
Control component
in action, and select theform
component that you want to update as the target of the event. - Choose the
submit
method and put{{circleProgress1.value == 100}}
inOnly run when
Similarly, we can configure the button to show warning when the user is trying to submit an uncompleted form.
- Click the
button
component to open its inspect page. UnderEvent handler
, click**+ New**
. - In the Edit event handler, select
Show notification
in action,title
"Error!" anddescription
"Please fill out the form before submitting". ChooseError
fortype
, put{{2000}}
for theduration
(2 seconds), and put{{circleProgress1.value<100}}
forOnly run when
.
We can also configure the **Form**
component to show a success message when submit.
- Click the
form
component to open its inspect page. UnderEvent handler
, click**+ New**
. - In the Edit event handler, select
Show notification
in action,title
"Submitted Successfully". ChooseSuccess
fortype
, put{{2000}}
for theduration
(2 seconds).