Components
ProgressView
Display measurable progress or an indeterminate task.
Example
Requires React 18.2+ or 19 and shared styles. See setup.
Default
Loading preview…
Code
'use client';
import { ProgressView } from '@swiftuijs/ui';
import { VStack } from '@swiftuijs/ui';
export default function Example() {
return ((<VStack spacing={16}>
<ProgressView aria-label="Zero progress" value={0}/>
<ProgressView aria-label="Quarter progress" value={0.25}/>
<ProgressView aria-label="Half progress" value={0.5}/>
<ProgressView aria-label="Three-quarter progress" value={0.75}/>
<ProgressView aria-label="Complete progress" value={1}/>
</VStack>));
}Usage and limitations
- Use
valueplustotalfor real units. Withouttotal,valueis a fraction from 0 to 1. Legacyprogressandcompletedaliases remain supported. indeterminateremoves numeric value semantics and animates when duration is unknown.labelandcurrentValueLabeldisplay task/progress text; keep them in sync with the actual work. Provide visible or accessible labeling and place progress near its task.
More examples
Determinate Values
Indeterminate Progress
Animated Progress
API reference
| Prop | Type | Required | Description |
|---|---|---|---|
value | number | No | The current progress value. When `total` is omitted, `value` is treated as a fractional value between 0 and 1. |
total | number | No | The total value for calculating progress. |
progress | number | No | Legacy fractional progress alias retained for existing callers. |
completed | number | No | Legacy current value alias retained for existing callers. |
indeterminate | boolean | No | Whether to show an indeterminate progress indicator. Default: false |
label | ReactNode | No | Optional leading label rendered alongside the progress indicator. |
currentValueLabel | ReactNode | No | Optional trailing value label rendered alongside the progress indicator. |
Inherits additional props from Omit<IBaseElementComponent<'div'>, 'children'>.