Progress
A bar showing how far a task has got, determinate or indeterminate.
Use a progress bar for a task that takes more than a second or two, such as an upload, or for a quota, such as seats used. For content that is loading into a layout, use a skeleton instead.
Installation
Pro components install from the Aloxe registry with the shadcn CLI. Once per project, add the registry to components.json and put a registry token in the ALOXE_TOKEN environment variable. Registry has the details.
{
"registries": {
"@aloxe": {
"url": "https://<aloxe-site>/r/{name}.json",
"headers": { "Authorization": "Bearer ${ALOXE_TOKEN}" }
}
}
}Then add the component:
npx shadcn@latest add @aloxe/progressThe CLI copies the source into components/ui/aloxe/, so it never overwrites your own ui components. It also installs @aloxe/react, @aloxe/tokens and @base-ui/react.
Import the tokens once in your global stylesheet, after Tailwind, and add an @source for the copied files and one for @aloxe/react, so Tailwind generates their classes. @source paths are relative to the stylesheet; these assume src/app/globals.css and src/components/ui/aloxe/.
@import "tailwindcss";
@import "@aloxe/tokens/aloxe.css";
@import "@aloxe/tokens/tailwind.css";
@source "../components/ui/aloxe";
@source "../../node_modules/@aloxe/react/dist";Installation covers the theme and brand attributes.
Usage
import { Progress } from "@/components/ui/aloxe/progress";
<Progress label="Uploading brand assets" value={64} />label is required, even when it's hidden. value runs from min (0) to max (100) and shows as a percentage unless you pass format or valueLabel.
Examples
Tones
accent for neutral progress, success when a task is complete or a value is healthy, danger when a quota is close to its limit.
Custom value text
For quotas, set max and show the amount with valueLabel. It is visual only, so pass the same words to getAriaValueText for screen readers.
Indeterminate and hidden labels
value={null} is indeterminate: no fill, a slow pulse, and no pulse with prefers-reduced-motion. showLabels={false} hides the label row when the context already says what the bar measures; the label still names it for screen readers.
Accessibility
| Key | Action |
|---|---|
| None | The bar isn't interactive or focusable. Put any related action, such as Cancel upload, next to it. |
role="progressbar"witharia-valuenow,aria-valuemin,aria-valuemaxandaria-valuetext, named bylabel.- An indeterminate bar drops
aria-valuenow, so screen readers don't announce a made-up value. - Tone colours repeat what the label and value already say; they never carry meaning alone.
- The fill doesn't animate when the value changes, so it never stutters on slow devices.
API reference
Renders a data-aloxe="progress" attribute and a data-tone you can target in CSS.
Progress
Extends Base UI Progress.Root.
| Prop | Type | Default | Description |
|---|---|---|---|
| value (required) | number | null | The current value between min and max. null means indeterminate: no fill and a slow pulse. | |
| label (required) | ReactNode | Names the progress bar, even when showLabels is false. | |
| showLabels | boolean | true | Shows the label and the value above the track. false keeps the name for screen readers only. |
| tone | "accent" | "success" | "danger" | "accent" | accent for neutral progress, success when complete or healthy, danger near a limit. |
| valueLabel | ReactNode | Shown instead of the percentage, such as 2 of 3 seats. Visual only: pass the same words to getAriaValueText. | |
| min | number | 0 | The lowest value. |
| max | number | 100 | The highest value. |
| format | Intl.NumberFormatOptions | Formats the value text. A percentage by default. | |
| getAriaValueText | (formattedValue: string, value: number | null) => string | The text screen readers announce for the value (aria-valuetext). | |
| className | string | Classes for the wrapper, such as a max width. |
Figma
Matches the Progress component in the Pro Figma file. Figma Tone (Accent, Success, Danger) maps to tone; Label, Value and Show labels map to label, valueLabel and showLabels.
See Figma for where to get the file and how its names map to code.
Pro
Progress is part of Aloxe Pro. The previews on this page are open to everyone; the Code tab shows the example source once you sign in with a Pro license. See Access and licenses and Pricing.