Progress
Horizontal and circular progress indicators with variants and indeterminate mode.
Rendering Progress…
Installation
Copy the source into your project with the CLI. It lands under @/components/ui and is yours to edit.
npx mlola-ui add progressUsage
import { Progress } from "@/components/ui/progress";
export default function Example() {
return <Progress value={64} label="Uploading" showLabel />;
}Styling comes from the engine stylesheet and the nearest theme. Set it once at the root:
<html data-theme="graphite" data-mode="light">HTML
The markup the example above renders, exactly. It needs no script: write it from any language or template.
<div class="ml-progress-root" data-tone="primary" data-size="md" data-state="determinate">
<div class="ml-progress-label">
<span>Uploading</span>
<span class="ml-progress-value" aria-hidden="true">0%</span>
</div>
<div class="ml-progress-track" role="progressbar" aria-label="Uploading" aria-valuemin="0" aria-valuemax="100" aria-valuenow="64" aria-valuetext="64%">
<div class="ml-progress-fill" aria-hidden="true" style="width:64%"></div>
</div>
</div>Options
| Component | Prop | Values | Default |
|---|---|---|---|
Progress | size | smmdlg | md |
Progress | tone | primaryinfosuccesswarningdanger | primary |
CircularProgress | size | smmdlg | md |
CircularProgress | tone | primaryinfosuccesswarningdanger | primary |
Every prop with a fixed set of values, read from the exported TypeScript types with its doc comment. Open the Code tab above for the rest of the API.
Classes and attributes
A class names each element; data-* and aria-* attributes carry its variant and state. The values listed are the ones the stylesheet draws; the default needs no attribute.
| Class | Attributes |
|---|---|
ml-progress-root | data-activedata-size="lg | sm"data-state="complete | indeterminate"data-tone="danger | info | success | warning" |
ml-progress-label | — |
ml-progress-value | — |
ml-progress-track | — |
ml-progress-fill | — |
ml-circular-progress | data-size="lg | sm"data-state="complete | indeterminate"data-tone="danger | info | success | warning" |
ml-circular-progress-svg | — |
ml-circular-progress-track | — |
ml-circular-progress-fill | — |
ml-circular-progress-label | — |
Accessibility and theming
- Semantic elements, accessible names and state relationships are part of the contract.
- Keyboard, pointer and touch paths are operable; focus stays visible in every theme.
- Light and dark modes pass WCAG AA contrast in all 5 canonical themes.
- Reduced motion and forced colors keep meaning and operation.