Progress
A bar or ring that shows how far a task has come, eases between updates and slides while the total is unknown.
- Feedback components
- 6 parts
- 12 examples
- vs shadcn/ui
@base-ui/reactclass-variance-authority
See it in a real product: Memory, Subagents, Test Results, and 4 more
View blockpnpm dlx shadcn@latest add https://hextaui.com/r/progress.jsonAdds the component, the HextaUI theme tokens and any HextaUI components it depends on.
Add the theme tokens to your global CSS, if you haven’t yet.
Install the dependencies.
pnpm add @base-ui/react class-variance-authority cnCopy and paste the following code into your project.
components/ui/progress.tsx Update the import paths to match your project setup.
<Progress /> draws its own track and indicator after its children, so a label and value sit on one line above the bar. Each update eases the fill from where it is, so rapid updates read as one smooth motion instead of steps.
xs, sm, default and lg change the bar's thickness. xs is the hairline Attachment draws along its bottom edge.
variant colors only the fill or ring, so the track, label and value stay neutral.
Pass segments to split the fill into parts, such as passed, failed and skipped tests. Each part eases on its own and pushes the parts after it, and their labels are read out with the value.
Pass value={null} while the total is unknown. A segment slides across the track, and once a number arrives the fill grows from the start.
<ProgressCircle /> draws the same value as a ring, starting at the top. Children sit in the middle, which fits <ProgressValue /> at lg and xl.
An arc spins around the ring until a value arrives.
Set min and max for any range, format for the number, and a function child on <ProgressValue /> for the text. Give screen readers the same words with getAriaValueText.
Render <NumberFlow /> inside <ProgressValue /> so only the digits that change spin, in step with the fill.
Long names wrap onto their own lines and the value stays on the end. Rings work as compact status beside each row.
Name the bar with aria-label when the context already says what is loading.
The fill and the indeterminate slide start from the right. Pass locale to format the value in the reader's digits.
- The root is a
progressbarwitharia-valuenow,aria-valuemin,aria-valuemaxand a formattedaria-valuetext. While indeterminate it has no current value. <ProgressLabel />names the bar. Without one, passaria-label.<ProgressValue />is hidden from screen readers, since the progressbar already announces the value.- With reduced motion, the fill jumps to each new value, and the indeterminate bar and ring pulse in place instead of moving.
- Values are formatted in
en-USunless you passlocale, so the server and browser render the same text.
Built on the Base UI progress. Every part accepts the props of the primitive it wraps.
| Prop | Type | Default |
|---|---|---|
valuenull makes the bar indeterminate. | number | null | – |
min | number | 0 |
max | number | 100 |
size | "xs" | "sm" | "default" | "lg" | "default" |
variant | "default" | "success" | "warning" | "destructive" | "default" |
segmentsSplits the fill into parts. Their sum becomes the value. tone colors a part with chart-1 to chart-5, for categories rather than status. | { value: number; variant?: ProgressVariant; tone?: ProgressTone; label?: string }[] | – |
formatFormats the value. Without it, the value shows as a percentage. | Intl.NumberFormatOptions | – |
locale | Intl.LocalesArgument | "en-US" |
getAriaValueText | (formattedValue: string, value: number | null) => string | – |
className | string | (state) => string | – |
render | ReactElement | (props, state) => ReactElement | <div> |
| Attribute | Description |
|---|---|
data-slot="progress" | The root. |
data-size | The size: xs, sm, default or lg. |
data-variant | The status variant. |
data-progressing | Present while the value is below max. |
data-complete | Present when the value reaches max. |
data-indeterminate | Present when the value is null or not a finite number. |
data-slot="progress-segment" | One part of a segmented fill, with its own data-variant and data-tone. data-gap marks a part that follows a filled one. |
Names the progressbar. Renders a <span> and takes the same state attributes as the root.
| Prop | Type | Default |
|---|---|---|
render | ReactElement | (props, state) => ReactElement | <span> |
| Attribute | Description |
|---|---|
data-slot="progress-label" | The label. |
| Prop | Type | Default |
|---|---|---|
childrenCustom text. Without it, the formatted value shows, or nothing while indeterminate. | (formattedValue: string | null, value: number | null) => ReactNode | – |
render | ReactElement | (props, state) => ReactElement | <span> |
| Attribute | Description |
|---|---|
data-slot="progress-value" | The value. |
Rendered by <Progress /> and sized by its size. Exported for custom compositions.
| Attribute | Description |
|---|---|
data-slot="progress-track" | The track. |
--progress-dir | 1, or -1 in right-to-left, so the indeterminate slide follows the reading direction. |
The fill. Its width is set inline from the value and eases between updates.
| Attribute | Description |
|---|---|
data-slot="progress-indicator" | The fill. |
| Prop | Type | Default |
|---|---|---|
valuenull spins an arc. | number | null | – |
min | number | 0 |
max | number | 100 |
size | "sm" | "default" | "lg" | "xl" | "default" |
variant | "default" | "success" | "warning" | "destructive" | "default" |
locale | Intl.LocalesArgument | "en-US" |
childrenShown in the middle of the ring. | ReactNode | – |
render | ReactElement | (props, state) => ReactElement | <div> |
| Attribute | Description |
|---|---|
data-slot="progress-circle" | The root. |
data-size | The size: sm, default, lg or xl. |
data-variant | The status variant. |
data-progressing | Present while the value is below max. |
data-complete | Present when the value reaches max. |
data-indeterminate | Present when the value is null or not a finite number. |
--progress-circle-size | The ring's width and height. |
--progress-stroke | The ring's stroke width. |
- AlertInline messages for status and feedback, with a neutral surface, a colored icon and a dismiss that collapses smoothly.
- EmptyA placeholder for screens with nothing to show yet, with an icon, a message and the next action.
- SkeletonPlaceholders that wait 150ms before showing, take the exact size of the content they wrap, and fade it in without moving anything.
- SpinnerA loading indicator with Apple-style ticks or a breathing ring that can wait before showing and stay long enough not to flicker.
- ToastBrief messages that stack neatly, expand on hover, swipe away, and turn a loading state into success or error in place.
- AttachmentFile and image cards for uploads, with progress, states, actions, a full-card trigger and names that keep their extension.
Used in Pro blocks
Blocks that build on Progress.
Every block comes with HextaUI Pro, and Prompt Input is free.