Feedback
Progress
Free2.8 KB gzippedLinear progress bar. Shows determinate progress with a smooth transition, or an indeterminate sweep when value is not set. The root carries role="progressbar" (or meter) with the ARIA range attributes.
Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · No keyboard interaction of its own · Full report
Import
import { Progress, ProgressSegments, CircularProgress } from "@vjdesigns/vjdesigns-ui";
Importing only Progress adds about 2.8 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.
Examples
Linear
import { Progress, Stack } from "@vjdesigns/vjdesigns-ui";
export function Linear() {
return (
<Stack gap={5} style={{ width: "100%", maxWidth: "26rem" }}>
<Progress label="Uploading report.pdf" value={64} showValue />
<Progress label="Profile complete" value={80} showValue tone="success" size="sm" />
<Progress label="Syncing" value={45} striped animated tone="info" />
</Stack>
);
}
Indeterminate
Pass value={null} when you can't measure progress.
import { Progress } from "@vjdesigns/vjdesigns-ui";
export function Indeterminate() {
return (
<div style={{ width: "100%", maxWidth: "26rem" }}>
<Progress label="Preparing your export" value={null} />
</div>
);
}
Segments
ProgressSegments splits one bar into labelled parts, with an optional legend.
import { ProgressSegments } from "@vjdesigns/vjdesigns-ui";
export function Segments() {
return (
<div style={{ width: "100%", maxWidth: "26rem" }}>
<ProgressSegments
label="Storage"
max={100}
showValue
showLegend
segments={[
{ value: 42, label: "Photos", tone: "primary" },
{ value: 18, label: "Documents", tone: "accent" },
{ value: 9, label: "Other", tone: "neutral" },
]}
/>
</div>
);
}
Tone steps
toneSteps changes the fill color with the value: red up to 40%, yellow up to 75%, then green. Color never carries the meaning alone, so the value is shown too. resolveProgressTone gives custom indicators the same bands.
import {
CircularProgress,
Flex,
Progress,
Stack,
} from "@vjdesigns/vjdesigns-ui";
export function ToneSteps() {
const steps = [{ upTo: 40, tone: "danger" }, { upTo: 75, tone: "warning" }, { tone: "success" }] as const;
return (
<Stack gap={5} style={{ width: "100%", maxWidth: "26rem" }}>
<Progress label="Free throws made" value={32} showValue toneSteps={steps} />
<Progress label="Field goals made" value={61} showValue toneSteps={steps} />
<Progress label="Practice attendance" value={92} showValue toneSteps={steps} />
<Flex gap={4}>
<CircularProgress label="Season goal" value={68} showValue toneSteps={steps} />
</Flex>
</Stack>
);
}
Circular
semantic="meter" is for measurements (disk usage, scores) rather than tasks in progress.
import { CircularProgress, Flex } from "@vjdesigns/vjdesigns-ui";
export function Circular() {
return (
<Flex gap={6} align="center">
<CircularProgress value={72} showValue label="Course progress" />
<CircularProgress value={91} showValue label="Health score" tone="success" semantic="meter" size="lg" />
<CircularProgress value={null} label="Loading" size="sm" />
</Flex>
);
}
Accessibility
label names the bar, and formatValue (or valueText) gives screen readers words instead of a bare number: "1.2 of 4 GB" rather than "30". An indeterminate bar can still say what's happening with valueText.
import { Progress, Stack } from "@vjdesigns/vjdesigns-ui";
export function Accessibility() {
return (
<Stack gap={5} style={{ width: "100%", maxWidth: "26rem" }}>
<Progress label="Uploading photos" value={1.2} max={4} showValue formatValue={(value, max) => `${value} of ${max} GB`} />
<Progress label="Preparing export" valueText="Collecting files" />
</Stack>
);
}
Translated
Percentages follow the locale (German shows "68 %"). Labels are your own text.
import {
CircularProgress,
Progress,
Stack,
LocaleProvider,
} from "@vjdesigns/vjdesigns-ui";
import de from "@vjdesigns/vjdesigns-ui/locales/de";
export function Translated() {
return (
<LocaleProvider locale="de" messages={de}>
<Stack gap={5} style={{ width: "100%", maxWidth: "26rem" }}>
<Progress label="Einrichtung" value={68} showValue tone="primary" />
<CircularProgress label="Speicher" value={42} showValue />
</Stack>
</LocaleProvider>
);
}
Right to left
The first example again, inside a right-to-left LocaleProvider (Arabic). Layout, spacing and arrow icons mirror, and the components' built-in text is translated. The example's own text stays in English.
Linear
import { LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ar from "@vjdesigns/vjdesigns-ui/locales/ar";
// Linear is the "Linear" example above.
<LocaleProvider locale="ar" messages={ar}>
<Linear />
</LocaleProvider>
API reference
Progress
| Prop | Type | Default |
|---|---|---|
sizeBar thickness: | "sm""md""lg" | — |
radiusCorner rounding of the track and fill. | "none""xs""sm""md""lg""xl""2xl""pill" | — |
stripedDiagonal stripes on the fill, for an energetic look. | boolean | — |
animatedMove the stripes (implies | boolean | — |
bufferSecondary, lighter fill behind the main one, in the same units as | number | — |
valueCurrent value. Leave | number | null | — |
minLower bound of the range. | number | — |
maxUpper bound of the range. | number | — |
toneSemantic color of the fill. Color never carries meaning alone: pair | "neutral""primary""accent""success""warning""danger""info" | — |
toneStepsNew in 3.5.1Change the fill color with the value. Bands are percentages of the range, checked in order; the first whose | readonly ProgressToneStep[] | — |
labelVisible label. Becomes the accessible name through | ReactNode | — |
showValueShow the formatted value (a percentage by default, see | boolean | — |
formatValueCustom value formatter, e.g. | ProgressFormatValue | — |
valueTextOverrides | string | — |
semanticARIA role: | "progressbar""meter" | — |
Also accepts native <div> attributes, plus className, style and ref.
ProgressSegments
Stacked bar made of labeled parts, with a legend (e.g. storage usage).
Accessibility: the bar is a single meter (or progressbar) whose value is the total, and whose aria-valuetext lists every segment ("Photos 42 GB, Apps 30 GB; 72 GB total"). The visual segments are hidden from assistive technology; the legend is a real list with text for every part, so the breakdown never depends on color.
| Prop | Type | Default |
|---|---|---|
segmentsRequiredThe parts, in order from the start of the bar. Their sum is clamped to | ProgressSegment[] | — |
maxTotal capacity (e.g. 256 for 256 GB). | number | — |
labelVisible label; the accessible name of the bar. Otherwise pass | ReactNode | — |
showValueShow the formatted total next to the label. | boolean | — |
formatValueFormats segment values and the total, e.g. | ProgressFormatValue | — |
valueTextOverrides the generated | string | — |
semanticARIA role of the bar. Defaults to | "progressbar""meter" | — |
sizeBar thickness: | "sm""md""lg" | — |
radiusCorner rounding of the track. | "none""xs""sm""md""lg""xl""2xl""pill" | — |
showLegendShow the legend (label and value for every segment). | boolean | — |
Also accepts native <div> attributes, plus className, style and ref.
CircularProgress
Ring-shaped progress indicator with rounded caps and an optional center slot. Determinate when value is set, spinning otherwise (a calm pulse under prefers-reduced-motion).
| Prop | Type | Default |
|---|---|---|
sizeRing diameter: | CircularProgressSize | — |
thicknessStroke width in pixels. Defaults scale with | number | — |
childrenContent in the center of the ring, e.g. an icon or custom text. Overrides the | ReactNode | — |
showValueShow the formatted value in the center, in bold display type. Not rendered at | boolean | — |
labelVisible caption under the ring; the accessible name. Otherwise pass | ReactNode | — |
valueCurrent value. Leave | number | null | — |
minLower bound of the range. | number | — |
maxUpper bound of the range. | number | — |
toneSemantic color of the fill. Color never carries meaning alone: pair | "neutral""primary""accent""success""warning""danger""info" | — |
toneStepsNew in 3.5.1Change the fill color with the value. Bands are percentages of the range, checked in order; the first whose | readonly ProgressToneStep[] | — |
formatValueCustom value formatter, e.g. | ProgressFormatValue | — |
valueTextOverrides | string | — |
semanticARIA role: | "progressbar""meter" | — |
Also accepts native <div> attributes, plus className, style and ref.
See what changed in each version in the Changelog.
Accessibility report
Progress targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.
axe-core audit (live)
Checking the examples above…
Lighthouse audit
Light mode
Score 10037 passed · 0 failed · 28 not applicable · 10 to check by hand
Dark mode
Score 10037 passed · 0 failed · 28 not applicable · 10 to check by hand
Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.
Built-in behavior
Keyboard
Not focusable, so there's no keyboard interaction of its own.
Roles and states
| Element | Role | States and properties |
|---|---|---|
| Bar or ring | progressbar | aria-valuenow, aria-valuemin, aria-valuemax, aria-valuetext; no aria-valuenow while indeterminate |
| Label | none | Names the progressbar through aria-labelledby |
ProgressSegments | list | One item per segment, with its value |
Manual checks
Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.
| Check | What to test | WCAG 2.2 |
|---|---|---|
| Keyboard | Every action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck. | 2.1.1 (A), 2.1.2 (A) |
| Focus | Focus moves in a logical order, is always visible, and isn't hidden behind sticky headers. | 2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA) |
| Screen readers | Names, roles and states are announced correctly, and status changes are announced without moving focus. | 1.3.1 (A), 4.1.2 (A), 4.1.3 (AA) |
| Color | Meaning never depends on color alone; your own colors meet contrast in both modes. | 1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA) |
| Zoom and reflow | At 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed. | 1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA) |
| Pointer targets | Click and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap. | 2.5.8 (AA), 2.5.5 (AAA) |
| Motion | Animations respect the reduced-motion setting. | 2.3.3 (AAA) |