Progress

A determinate or indeterminate progress bar, with an optional label.

Profile completion
x
Uploading…
x
Storage used
x
<Progress.Root value={35}>
	<Progress.Label>Profile completion</Progress.Label>
	<Progress.Value />
</Progress.Root>

value={null} is the indeterminate state — the bar loops instead of filling. Progress.Value takes a formatter child when a percentage is not what you want to show.

API

Progress.Root

PropTypeDefault
indicatorClassNamestring
trackClassNamestring
valuenumber | nullrequiredThe current value. The component is indeterminate when value is null.
aria-valuetextstringA string value that provides a user-friendly name for aria-valuenow, the current value of the progress bar.
classNamestring | ((state: ProgressRootState) => string | undefined)CSS class applied to the element, or a function that returns a class based on the component's state.
formatNumberFormatOptionsOptions to format the value.
getAriaValueText((formattedValue: string | null, value: number | null) => string)Accepts a function which returns a string value that provides a human-readable text alternative for the current value of the progress bar.
localeLocalesArgumentThe locale used by Intl.NumberFormat when formatting the value. Defaults to the user's runtime locale.
maxnumberThe maximum value.
minnumberThe minimum value.
renderComponentRenderFn<HTMLProps, ProgressRootState> | ReactElement<unknown, string | JSXElementConstructor<any>>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleCSSProperties | ((state: ProgressRootState) => CSSProperties | undefined)Style applied to the element, or a function that returns a style object based on the component's state.

Plus the DOM props of the element it renders. Source: progress/components/progress-root.tsx.

Progress.Label

PropTypeDefault
classNamestring | ((state: ProgressLabelState) => string | undefined)CSS class applied to the element, or a function that returns a class based on the component's state.
renderComponentRenderFn<HTMLProps, ProgressLabelState> | ReactElement<unknown, string | JSXElementConstructor<any>>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleCSSProperties | ((state: ProgressLabelState) => CSSProperties | undefined)Style applied to the element, or a function that returns a style object based on the component's state.

Plus the DOM props of the element it renders. Source: progress/components/progress-label.tsx.

Progress.Value

PropTypeDefault
children((formattedValue: string | null, value: number | null) => ReactNode) | null
classNamestring | ((state: ProgressValueState) => string | undefined)CSS class applied to the element, or a function that returns a class based on the component's state.
renderComponentRenderFn<HTMLProps, ProgressValueState> | ReactElement<unknown, string | JSXElementConstructor<any>>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleCSSProperties | ((state: ProgressValueState) => CSSProperties | undefined)Style applied to the element, or a function that returns a style object based on the component's state.

Plus the DOM props of the element it renders. Source: progress/components/progress-value.tsx.