[ Feedback ]
Progress
A horizontal bar showing how far a task has progressed. Leave value out for an indeterminate, looping bar.
Import#
import { Progress } from 'reusify-ui';When to use#
- File uploads, multi-step processes, quotas and usage meters.
Examples#
With label & value#
<Progress value={45} label="Uploading report.pdf" showValue />Colors & sizes#
<Progress value={30} size="sm" />
<Progress value={60} color="success" />
<Progress value={85} color="warning" size="lg" />
<Progress value={95} color="danger" label="Storage" showValue />Indeterminate#
Omit value when you don't know how long it will take.
<Progress label="Processing…" />Ticks variant#
variant="ticks" draws a filled bar with a marker at the value, then tick marks for what is left. color also takes any CSS color or gradient.
<Progress
variant="ticks"
value={67}
ticks={26}
showValue
color="linear-gradient(90deg, #38bdf8, #2563eb 70%, #60a5fa)"
/>
<Progress variant="ticks" value={35} size="sm" color="success" />Bars variant and glow#
variant="bars" is a row of thin bars, colored up to the value with a taller marker. glow adds a soft halo in the bar color (pass a color when color is a gradient).
<Progress variant="bars" value={64} ticks={48} color="#f26b3a" label="Progress" showValue />
<Progress value={68} size="lg" color="#4ade80" glow />Capsule variant#
variant="capsule" is a thick pill: the fill carries an icon at its end (or the percentage with showValue) and endLabel sits on the right. Pair it with a gradient and glow for a live tracker.
<Progress
variant="capsule"
value={46}
color="linear-gradient(90deg, #e9f97a, #a3e635 60%, #65a30d)"
glow="#a3e635"
icon={<MdFlight style={{ transform: 'rotate(90deg)' }} />}
endLabel="-7H 01M"
/>
<Progress variant="capsule" size="sm" value={72} color="info" showValue endLabel="2 of 3 GB" />Used in designs#
Progress in real layouts: these 9 designs use it. Open one to try it and copy the code.
- Get started checklistTasks & workflow
- Total projectDashboard widgets
- Flight trackerDashboard widgets
- Reset passwordAuthentication
- Monthly budgetPricing & billing
- Plan usagePricing & billing
- Streak widgetSocial & fitness
- Upload statusProductivity
- BlockersProductivity
API reference#
<Progress />
Also accepts every <div> attribute.
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | - | Current value. Omit for indeterminate. |
max | number | 100 | Value that means "complete". |
variant | 'bar' | 'ticks' | 'bars' | 'capsule' | 'bar' | Plain bar; fill + marker + ticks; a row of thin bars; or a thick pill with an icon. |
icon | ReactNode | - | Icon at the end of the fill (capsule). |
endLabel | ReactNode | - | Text at the right end of the track (capsule). |
glow | boolean | string | false | Soft halo; true uses the color, a string sets the glow color. |
ticks | number | 24 | Ticks for a full track (ticks and bars variants). |
label | ReactNode | - | Text above the bar (also used as aria-label when a string). |
showValue | boolean | false | Shows the percentage (inside the fill for ticks). |
size | 'sm' | 'md' | 'lg' | 'md' | Bar thickness. |
color | semantic | string | 'primary' | Semantic name, or any CSS color or gradient. |
value-numberCurrent value. Omit for indeterminate.
max100numberValue that means "complete".
variant'bar''bar' | 'ticks' | 'bars' | 'capsule'Plain bar; fill + marker + ticks; a row of thin bars; or a thick pill with an icon.
icon-ReactNodeIcon at the end of the fill (capsule).
endLabel-ReactNodeText at the right end of the track (capsule).
glowfalseboolean | stringSoft halo; true uses the color, a string sets the glow color.
ticks24numberTicks for a full track (ticks and bars variants).
label-ReactNodeText above the bar (also used as aria-label when a string).
showValuefalsebooleanShows the percentage (inside the fill for ticks).
size'md''sm' | 'md' | 'lg'Bar thickness.
color'primary'semantic | stringSemantic name, or any CSS color or gradient.
Accessibility#
- Uses role="progressbar" with aria-valuemin, aria-valuemax and aria-valuenow (omitted when indeterminate).