Progress - Linear
An element that shows either determinate or indeterminate progress.
Anatomy
To set up the progress correctly, you'll need to understand its anatomy and how we name its parts.
Each part includes a
data-partattribute to help identify them in the DOM.
Examples
Learn how to use the Progress component in your project. Let's take a look at
the most basic example:
Example not foundExample not foundExample not foundSetting the initial value
To set the progress's initial value, set the defaultValue prop to a number.
Example not foundExample not foundExample not foundSpecifying the minimum and maximum
By default, the maximum is 100. If that's not what you want, you can easily
specify a different bound by changing the value of the max prop. You can do
the same with the minimum value by setting the min prop.
For example, to show the user a progress from 10 to 30, you can use:
Example not foundExample not foundExample not foundUsing the indeterminate state
The progress component is determinate by default, with the value and max set to 50 and 100 respectively.
Set the state to indeterminate in Progress.Indicator:
Example not foundExample not foundExample not foundShowing a value text
Progress bars can only be interpreted by sighted users. To include a text
description to support assistive technologies like screen readers, use the
value part in translations.
Example not foundExample not foundExample not foundChanging the orientation
By default, the progress is assumed to be horizontal. To change the orientation to vertical, set the orientation property in the machine's context to vertical.
Don't forget to change the styles of the vertical progress by specifying its height
Example not foundExample not foundExample not foundAPI Reference
Root
| Prop | Default | Type |
|---|---|---|
asChild | booleanRender as a different element type. | |
id | stringThe unique identifier of the machine. | |
ids | Partial<{ root: string; track: string; label: string; circle: string }>The ids of the elements in the progress bar. Useful for composition. | |
max | numberThe maximum allowed value of the progress bar. | |
min | numberThe minimum allowed value of the progress bar. | |
orientation | 'horizontal' | OrientationThe orientation of the element. |
translations | IntlTranslationsThe localized messages to use. | |
value | numberThe current value of the progress bar. |
Circle
| Prop | Default | Type |
|---|---|---|
asChild | booleanRender as a different element type. |
CircleRange
| Prop | Default | Type |
|---|---|---|
asChild | booleanRender as a different element type. |
CircleTrack
| Prop | Default | Type |
|---|---|---|
asChild | booleanRender as a different element type. |
Label
| Prop | Default | Type |
|---|---|---|
asChild | booleanRender as a different element type. |
Range
| Prop | Default | Type |
|---|---|---|
asChild | booleanRender as a different element type. |
Track
| Prop | Default | Type |
|---|---|---|
asChild | booleanRender as a different element type. |
ValueText
| Prop | Default | Type |
|---|---|---|
asChild | booleanRender as a different element type. |
View
| Prop | Default | Type |
|---|---|---|
state | ProgressState | |
asChild | booleanRender as a different element type. |