A quiet linear indicator for showing the completion of an ongoing process. Its tonal track sits within the surrounding surface while the fill carries emphasis.
| Prop | Type | Default | Description |
|---|---|---|---|
| progress | number | Required | Progress from 0 to 1; values are safely clamped |
| color | Color | "highlight" | Semantic fill color |
| size | "small" | "medium" | "medium" | Track height: 4px or 8px |
| aria-label | string | "Progress" | Accessible name when no visible label exists |
| aria-labelledby | string | - | ID of a visible label |
| jss | JSS | - | Custom styles for the track |
<ProgressBar progress={0.66} aria-label="Upload progress" />
small
medium
<ProgressBar progress={0.5} size="small" /> // 4px
<ProgressBar progress={0.5} size="medium" /> // 8px, default
<ProgressBar color="highlight" progress={0.66} /> // Accent color
<ProgressBar color="negative" progress={0.66} /> // Error/danger
<ProgressBar color="warning" progress={0.66} /> // Warning
0%
25%
50%
75%
100%
<ProgressBar progress={0} /> // Empty
<ProgressBar progress={0.5} /> // Half
<ProgressBar progress={1} /> // Complete
function UploadProgress({ progress }) {
const percentage = Math.round(progress * 100);
return (
<Column gap="small">
<Row justify="space-between">
<Span id="upload-progress-label">Uploading assets</Span>
<Span color="secondary">{percentage}%</Span>
</Row>
<ProgressBar
progress={progress}
aria-labelledby="upload-progress-label"
/>
</Column>
);
}
function StorageIndicator({ used, total }) {
const progress = used / total;
// Change color based on usage
const color =
progress > 0.9 ? "negative" : progress > 0.7 ? "warning" : "highlight";
return (
<Column gap="small">
<Row justify="space-between">
<Span>Storage</Span>
<Span color="secondary">{Math.round(progress * 100)}% used</Span>
</Row>
<ProgressBar color={color} progress={progress} size="small" />
</Column>
);
}
ProgressBar renders the progressbar role and percentage-based ARIA values. Connect a visible description with aria-labelledby; use aria-label when there is no visible label.