Progress
Determinate linear, circular and segmented progress driven on UI.
npx @swipeui/cli add progressWhen to use it
- Uploads, downloads and installs where you know how far along it is.
- Profile completion or course progress.
- Circular progress for goals like a daily step target.
- Segmented bars for multi-part tasks.
When not to use it
- Unknown durations. Use Spinner.
- Allowances with limits and categories. Use Usage meter.
- Steps in a flow with names. Use Stepper.
Installation
Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.
npx @swipeui/cli add progress- Adds
components/swipeui/ui/progress.tsxand 4 shared helpers. - Installs react-native-reanimated, react-native-svg, uniwind, clsx, tailwind-merge, react-native-worklets, class-variance-authority. In Expo apps it uses
npx expo installso versions match your SDK.
Usage
import { Progress } from '@/components/swipeui/ui/progress';
<Progress value={0.6} label="Upload" showValue />;Examples
Use the variant and appearance controls in the live specimen to compare the documented states. The application owns validation, operation results and persistence.
API reference
ProgressProps
| Prop | Type | Default | Description |
|---|---|---|---|
completionEffect? | | | Rainbow finish on segmented progress. |
completionPulse? | | | Pulse the completed colours. |
completionLoop? | | | Repeat the finish wave while complete. |
active? | | | Caller viewability override for ambient motion. |
value | | — | Fraction complete, clamped to 0–1. |
variant? | | | Shape. |
segments? | | | Segment count, integer 1–40. |
size? | | | Circle diameter in points. |
label? | | | Spoken purpose. |
showValue? | | | Show numeric completion beside the track. |
motion? | | — | Shared number motion. |
className? | | — | Root classes. |
style? | | — | Native layout escape hatch. |
testID? | | — | Root ID. |
Native view/input props not listed here pass through where the exported TypeScript type allows them.
Composition and behavior
- variant is linear, circular or segmented; segments sets the count.
- size sets the circle diameter (64 points).
- label and showValue control what's read and shown.
Feedback lineup settings
| Prop | Does / default |
|---|---|
completionEffect | Rainbow finish on segmented progress. @default true |
completionPulse | Pulse the completed colours. @default true |
completionLoop | Repeat the finish wave while complete. @default false |
active | Caller viewability override for ambient motion. @default true |
value | Fraction complete, clamped to 0–1. |
variant | Shape. @default 'linear' |
segments | Segment count, integer 1–40. @default 5 |
size | Circle diameter in points. @default 64 |
label | Spoken purpose. @default 'Progress' |
showValue | Show numeric completion beside the track. @default false |
motion | Shared number motion. |
className | Root classes. |
style | Native layout escape hatch. |
testID | Root ID. |
Behaviour
Segmented completion plays one travelling rainbow then restores the primary fill. completionEffect, completionPulse and completionLoop are independent; active pauses ambient work. Reduce Motion retains a static completed track.
Segmented completion now defaults to a single rainbow cycle, then restores the normal primary fill. completionLoop defaults to false; opt in to retain repeating waves. completionEffect and completionPulse stay independent. Background/offscreen work pauses, and Reduce Motion keeps the completed primary track.
Behavior and gestures
- Static; it moves smoothly to each new value you pass.
- showValue adds the percentage beside the track.
Accessibility
- Announced as a progress bar with its label and percentage, for example "Upload, 40%".
- Give it a meaningful label; the default is "Progress".
- The ring and segments are drawn decoratively; the value carries the meaning.
Motion
- Uses the
numbermotion role, so it follows your app's feel. Passmotionto tune this one instance. - The fill eases between values with the number role.
- Reduce Motion jumps to the new value.
Performance
- Animates on the UI thread; update as often as needed.
Notes for AI
- value is a fraction from 0 to 1.
Compatibility
| Runs on | Supported |
|---|---|
| Expo SDK 57 | Yes |
| Expo SDK 58 | Yes |
| React Native CLI (with Expo modules) | Yes |
| Expo Go | Yes |
| iOS | Yes |
| Android | Yes |
This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.