<!-- index: /slotted/llms.txt -->
# progress-indicator

`data-ui="progress-indicator"` · Progress bar or ring, known or indeterminate.

## Import

```tsx
import { ProgressBar, ProgressCircle, Loader, ProgressIndicatorDefaultsProvider } from '@slotted/react';
```

## Minimal example

Example

```tsx
import { ProgressBar } from '@slotted/react/progress-indicator';

export default function ProgressIndicatorBasic() {
  return <ProgressBar label="Uploading invoices" showValue value={40} />;
}
```

## Anatomy

| Part | Element | Required |
| --- | --- | --- |
| `root` | div | yes |
| `label` | span | no |
| `value` | span | no |
| `track` | div, or an svg circle | yes |
| `indicator` | div, or an svg circle or path | yes |

## Props

| Name | Type | Default | Applies to | Description |
| --- | --- | --- | --- | --- |
| `value` | `number \| null` | null (indeterminate) | ProgressBar, ProgressCircle | The quantity. Absent or null is a wait rather than nought per cent, and a value outside the range is clamped |
| `min` | `number` | 0 | ProgressBar, ProgressCircle | The bottom of the range, and what aria-valuemin reports |
| `max` | `number` | 100 | ProgressBar, ProgressCircle | The top of the range, and what aria-valuemax reports. Reaching it writes data-complete |
| `buffer` | `number \| null` | — | ProgressBar | A second, further quantity: received but not yet processed. Never painted behind the value |
| `size` | `sm \| md \| lg` | md | all three | The bar’s thickness, the ring’s diameter, the loader’s box. Rings and loaders read the control height scale, so they match a control of the same step |
| `tone` | `accent \| secondary \| info \| success \| warning \| danger` | accent | all three | The six tones the theme provides. The indicator is the tone’s text role and the track is a computed tint of it |
| `label` | `string` | — | all three | The rendered accessible name. Without it, or aria-label, or decorative, a development warning names the component |
| `hideLabel` | `boolean` | false | all three | Clips the label with visually-hidden and keeps it as the name. A page-level bar sets it by itself |
| `showValue` | `boolean` | false | ProgressBar, ProgressCircle | Whether the formatted number is rendered beside the name. A wait needs no number to be understood |
| `valueText` | `string` | — | ProgressBar, ProgressCircle | A string the component cannot compute — “3 of 7 files”. It becomes both aria-valuetext and the rendered value |
| `format` | `Intl.NumberFormatOptions` | — | ProgressBar, ProgressCircle | How the number is written, applied to the value. Absent, the ratio is written as a percentage |
| `locale` | `string` | — | ProgressBar, ProgressCircle | BCP 47. Absent, the provider’s, then the runtime’s own |
| `wave` | `boolean` | false | ProgressBar, ProgressCircle | M3 Expressive’s wavy active indicator. The ring grows a fifth to make room for its crests |
| `contained` | `boolean` | false | Loader | M3’s fully rounded container behind the morphing shape, at M3’s own 38:48 ratio |
| `placement` | `inline \| page \| edge-start \| edge-end` | inline | ProgressBar | page pins the bar to the top edge of the viewport, squares it, drops its track and reads the sticky stacking token; edge-start and edge-end stand it on the block-start or block-end edge of the nearest positioned box, over the line that edge draws. Every value but inline clips the label and grows the bar out of its edge |
| `decorative` | `boolean` | false | all three | Takes the indicator out of the accessibility tree — no role, no range, no name — for a spinner beside text that already says what is happening |
| `loading` | `boolean` | true | all three | Whether the wait is still on. false withdraws the indicator, honoring minDuration |
| `delay` | `number` | 0 | all three | Milliseconds the wait must last before anything is painted. Until then the root carries hidden — no box and no reserved band |
| `minDuration` | `number` | 0 | all three | Milliseconds an indicator that did appear is held before it is withdrawn |
| `render` | `(props) => ReactNode` | — | all three | Substitutes the rendered root. Every data attribute, the role, the range and the percentage custom property are handed to it |
| `ref` | `Ref<HTMLDivElement>` | — | all three | Reaches the root; each component’s props are that element’s, extended |
| `ProgressIndicatorDefaultsProvider` | `ProgressIndicatorDefaults` | — | Application | Sets size, tone, delay, minDuration, locale and label once for everything below it; a prop on an indicator still wins |
| `aria-busy, aria-describedby` | `boolean, string` | — | Your own region | ARIA asks a consumer to write both on the region that is loading, pointing at the indicator’s id. The component cannot: the region is yours |
| `InlineMessage` | `ReactNode` | — | Beside the indicator | The words that carry the wait. role="progressbar" prunes its own subtree, so a message inside an indicator is never heard — it belongs next to one |

## Events

| Name | Payload | When |
| --- | --- | --- |
| `onWithdraw` | `void` | The indicator actually leaves the page — later than loading turning false whenever minDuration is still holding it. It is the moment an application unmounts the card the indicator was in. |

## Axes and defaults

| Axis | Values | Default |
| --- | --- | --- |
| `size` | `sm`, `md`, `lg` | `md` |
| `tone` | `accent`, `secondary`, `info`, `success`, `warning`, `danger` | `accent` |
| `placement` | `inline`, `page`, `edge-start`, `edge-end` | `inline` |

## Rules

- The root carries role="progressbar" with aria-valuemin and aria-valuemax written out, and aria-valuenow only while there is a value. ARIA 1.3 asks an author to omit aria-valuenow when the value is indeterminate, and the omission is what says “in progress, and nobody knows how far”.
- A value outside the range is clamped, and the clamped value is what both the paint and aria-valuenow report — so the picture a reader sees and the number a reader hears cannot disagree. Progress is usually computed from numbers an application does not fully control.
- progressbar carries Children Presentational: True in ARIA 1.3, which means everything inside the root is pruned from the accessibility tree. The label reaches a reader through aria-labelledby and the number through aria-valuetext; anything else you put inside is silent. A live region inside an indicator is silent too, which is why the words that carry a wait belong to InlineMessage beside it rather than to a hidden region within it.
- An accessible name is required, and there are three ways to give one: label, your own aria-label or aria-labelledby, or decorative for a spinner beside text that already says what is happening. With none of the three, development warns and the indicator still renders: a nameless bar reports visually, and taking a screen down mid-upload is worse than the defect.
- If the indicator describes the loading of a region, ARIA asks you to set aria-busy on that region and point aria-describedby at the indicator. The component writes neither, because the region is yours.
- Under prefers-reduced-motion every loop stops rather than shortening — an animation that repeats forever needs to stop, and the indeterminate indicator rests at a length that reads as a fraction rather than as nought or as full. The cost is real: a still indicator says nothing on its own, so the name matters more, and the loader is best given a visible label.
- The indicator is a tone’s text role, which the theme holds to the 4.5:1 reading ratio against every surface — more than the 3:1 WCAG 2.2 1.4.11 asks of a meaningful graphic — in all three color schemes. Under forced colors the track keeps a ButtonBorder edge and the indicator takes Highlight, so the geometry survives a palette the family did not choose.

## Tokens

`--slotted-border-strong`, `--slotted-border-width-thin`, `--slotted-control-font-family`, `--slotted-control-font-size-lg`, `--slotted-control-font-size-md`, `--slotted-control-font-size-sm`, `--slotted-control-height-lg`, `--slotted-control-height-md`, `--slotted-control-height-sm`, `--slotted-duration-long`, `--slotted-duration-loop`, `--slotted-duration-loop-slow`, `--slotted-duration-medium`, `--slotted-duration-short`, `--slotted-easing-emphasized`, `--slotted-easing-enter`, `--slotted-easing-exit`, `--slotted-easing-standard`, `--slotted-line-height-md`, `--slotted-progress-indicator-buffer-color`, `--slotted-progress-indicator-buffer-percent`, `--slotted-progress-indicator-gap`, `--slotted-progress-indicator-indicator-color`, `--slotted-progress-indicator-percent`, `--slotted-progress-indicator-position`, `--slotted-progress-indicator-radius`, `--slotted-progress-indicator-size`, `--slotted-progress-indicator-stroke`, `--slotted-progress-indicator-thickness`, `--slotted-progress-indicator-track-color`, `--slotted-progress-indicator-travel-size`, `--slotted-progress-indicator-travel-start`, `--slotted-progress-indicator-wave-amplitude`, `--slotted-progress-indicator-wave-phase`, `--slotted-radius-full`, `--slotted-radius-none`, `--slotted-space-2`, `--slotted-space-3`, `--slotted-space-4`, `--slotted-surface`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-accent-text`, `--slotted-tone-danger-text`, `--slotted-tone-info-text`, `--slotted-tone-success-text`, `--slotted-tone-warning-text`, `--slotted-z-index-sticky`

## Examples

See [progress-indicator.examples.md](./progress-indicator.examples.md).
