import { ProgressBar } from "@senvenli/react/feedback";
export default function Example() {
return <ProgressBar label="Importing contacts" value={142} maxValue={220} valueLabel="142 / 220" />;
}import { ProgressBar, ProgressCircle } from "@senvenli/react/feedback";Examples
Unknown length
A segment sweeps across while the task runs.import { ProgressBar } from "@senvenli/react/feedback";
export default function Example() {
return <ProgressBar label="Preparing your export" isIndeterminate />;
}Finished and failed
`success` and `danger` close the task, each with a word in the value.import { ProgressBar } from "@senvenli/react/feedback";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack space="space-300">
<ProgressBar label="Account setup" size="large" value={3} maxValue={5} valueLabel="3 / 5 steps" />
<ProgressBar label="Importing contacts" tone="success" value={220} maxValue={220} valueLabel="Done · 220 contacts" />
<ProgressBar label="Importing orders" tone="danger" value={64} maxValue={180} valueLabel="Failed at 64 / 180" />
</Stack>
);
}Circle
ProgressCircle, for places with no width to spare.import { Text } from "@senvenli/react/display";
import { ProgressCircle } from "@senvenli/react/feedback";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-400" align="end">
<Stack direction="horizontal" space="space-100">
<ProgressCircle size="small" value={40} aria-label="Uploading report" />
<Text size="body-small" tone="subtle">Uploading 40%</Text>
</Stack>
<ProgressCircle value={72} label="Profile" />
<ProgressCircle size="large" value={86} label="Seats in use" isMeasurement />
<ProgressCircle isIndeterminate aria-label="Syncing orders" />
</Stack>
);
}Guidelines
When to use it
- A task takes a while and its progress is known or ongoing.
Use something else when
- Something short is loading. Spinner
Accessibility
Built in
- Exposed as a progressbar with its value text.
You provide
- A
labelthat says what is in progress.
API reference
ProgressBar
| Prop | Type | Default | Description |
|---|---|---|---|
labelRequired | React.ReactNode | – | What is in progress ("Importing contacts"). |
value | number | – | |
minValue | number | – | |
maxValue | number | – | |
valueLabel | React.ReactNode | – | Real units where they exist ("142 / 220", "3 / 5 steps"); defaults to the percentage. |
isIndeterminate | boolean | – | A task of unknown length: a 30% segment sweeps across. |
tone | ProgressTone | – |
|
size | "medium" | "large" | – |
|
motion | ComponentMotion | – |
|
labelRequiredReact.ReactNodeWhat is in progress ("Importing contacts").
valuenumberminValuenumbermaxValuenumbervalueLabelReact.ReactNodeReal units where they exist ("142 / 220", "3 / 5 steps"); defaults to the percentage.
isIndeterminatebooleanA task of unknown length: a 30% segment sweeps across.
toneProgressTonesuccess/dangerfor a finished or failed task; pair it with a word invalueLabel.size"medium" | "large"medium(4px, default);large(8px) for onboarding.motionComponentMotionauto(follow the device),reduceornone, for this component; the provider's setting otherwise.
ProgressCircle
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | 0 | |
minValue | number | 0 | |
maxValue | number | 100 | |
size | ProgressCircleSize | "medium" | 20px (no value text; give the value in adjacent text or a Tooltip), 48px, 80px. |
label | React.ReactNode | – | A visible label under the ring, or |
aria-label | string | – | |
isIndeterminate | boolean | – | |
isMeasurement | boolean | – | A ratio that is a measurement (doluluk, kota), not progress: announced as a meter. |
tone | ProgressTone | "brand" | |
valueLabel | string | – |
valuenumberDefault0minValuenumberDefault0maxValuenumberDefault100sizeProgressCircleSizeDefault"medium"20px (no value text; give the value in adjacent text or a Tooltip), 48px, 80px.
labelReact.ReactNodeA visible label under the ring, or
aria-labelwhen there is none.aria-labelstringisIndeterminatebooleanisMeasurementbooleanA ratio that is a measurement (doluluk, kota), not progress: announced as a meter.
toneProgressToneDefault"brand"valueLabelstring