suiss/ui · Component
Progress
A horizontal bar that shows the completion of a task.
Progress is an open-source component from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
Progress wraps the progress primitive of the chosen base. Progress is the root and always renders a ProgressTrack containing a ProgressIndicator after its children. Add a ProgressLabel to name the bar and a ProgressValue to show the formatted value; they sit on one row above the track.
Use Progress for determinate or indeterminate task progress.
Installation
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
- Install the following dependencies and add the
cnhelper:
- Copy and paste the following code into your project.
- Update the import paths to match your project setup.
Usage
Composition
Use the following composition to build a Progress:
Examples
With label
Add a ProgressLabel and a ProgressValue as children to show a label and the current value on one row above the track.
Complete
A labelled bar with value set to 100.
Indeterminate
A labelled bar with value={null} for work of unknown length.
A labelled bar with isIndeterminate for work of unknown length.
Accessibility
- The root has the
progressbarrole witharia-valuenowreflecting the value. ProgressLabelprovides the accessible name. Without it, passaria-label.
- When
valueisnull,aria-valuenowis omitted to signal an indeterminate state.
- With
isIndeterminate,aria-valuenowis omitted to signal an indeterminate state.
API Reference
Progress
The root that holds the value and renders the track and indicator.
| Prop | Type | Default |
|---|---|---|
value | number | null | — |
min | number | 0 |
max | number | 100 |
| Prop | Type | Default |
|---|---|---|
value | number | null | null |
max | number | 100 |
| Prop | Type | Default |
|---|---|---|
value | number | 0 |
minValue | number | 0 |
maxValue | number | 100 |
isIndeterminate | boolean | false |
Also accepts the props of the primitive part it wraps.
Pass value as a number between min and max; min is the value of an empty bar and max of a full one. Set value={null} for an indeterminate bar when the amount of work is unknown.
Pass value as a number between 0 and max, the value of a full bar. Leave value out, or set value={null}, for an indeterminate bar when the amount of work is unknown.
Pass value as a number between minValue and maxValue, the values of an empty and a full bar. Set isIndeterminate for an indeterminate bar when the amount of work is unknown.
The track and indicator are rendered for you after the children, so ProgressTrack and ProgressIndicator are not needed inside Progress. The indicator animates width changes.
ProgressTrack
The full-width rail behind the indicator.
Also accepts the props of the primitive part it wraps.
ProgressIndicator
The filled portion of the track that reflects the value.
Also accepts the props of the primitive part it wraps.
ProgressLabel
Text that names the progress bar.
Also accepts the props of the primitive part it wraps.
ProgressValue
The formatted current value, aligned to the end of the row.
Also accepts the props of the primitive part it wraps.
The value is shown as a percentage by default.
Each part sets a data-slot, such as progress-track or progress-indicator, for styling.
Web preview
Progress renders a thin track with an indicator whose width follows value. The width animates with a Reanimated spring, clamped between 0 and 100 percent. Any children, such as ProgressLabel and ProgressValue, are placed in a row above the bar.
Use it for uploads, downloads and other tasks with a known amount of work.
Installation
- Install the following dependencies:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/progress.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/progress.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/progress.tsx:
- Update the import paths to match your project setup.
-
Target iOS 17 or later.
-
Copy the theme files every view uses:
- Copy the source:
- Add the files to your app target.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 24 or higher, and add the dependencies:
- Copy the theme files every view uses:
- Copy the source:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Examples
With label
A bar with a caption and a live percentage value at the end of the row.
Web preview
Complete
A bar with value set to 100.
Web preview
Values
Bars at 0, 25, 50, 75 and 100 percent, the last with a custom indicator color.

This code uses Tailwind classes that need Uniwind or NativeWind. With StyleSheet, pass the same values through the style props.
Accessibility
- The root has the
progressbarrole and reportsmin,max, the current value and a value text, so VoiceOver and TalkBack announce the progress. - Use
getAccessibilityValueTextto customize the announced text.
API Reference
Progress
Root that holds the value and renders the track and indicator.
| Prop | Type | Default |
|---|---|---|
trackClassName | string | - |
indicatorClassName | string | - |
Also accepts the props of React.ComponentProps<typeof ProgressPrimitive.Root>.
Set value between min and max (0 and 100 by default). Pass null when the progress is unknown. trackClassName and indicatorClassName add classes to the track and the indicator. ProgressTrack and ProgressIndicator are also exported for custom layouts.
ProgressTrack
Background bar.
Also accepts the props of React.ComponentProps<typeof ProgressPrimitive.Track>.
ProgressIndicator
Animated fill that shows the current value.
Also accepts the props of React.ComponentProps<typeof ProgressPrimitive.Indicator>.
ProgressLabel
Caption text above the bar.
Also accepts the props of React.ComponentProps<typeof ProgressPrimitive.Label>.
ProgressValue
Formatted value text, aligned to the end.
Also accepts the props of React.ComponentProps<typeof ProgressPrimitive.Value>.
Format the value with format and locale. The value uses tabular numbers.
.progressViewStyle(.bar)
Style that creates BarProgressViewStyle.
Takes no parameters.
Progress
Root that holds the value and renders the track and indicator.
| Parameter | Type | Default |
|---|---|---|
value | Float? | - |
modifier | Modifier | Modifier |
max | Float | 100f |
label | String? | null |
showValue | Boolean | false |
