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—
exitExit—Inside a <Presence>: plays this child's way out before it unmounts.
valuenumber | nullrequiredThe current value. The component is indeterminate when value is null.
aria-valuetextstring—A 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.
formatNumberFormatOptions—Options to format the value.
getAriaValueText((formattedValue: string, 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.
localeLocalesArgument—The locale used by Intl.NumberFormat when formatting the value. Defaults to the user's runtime locale.
maxnumber—The maximum value.
minnumber—The 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
exitExit—Inside a <Presence>: plays this child's way out before it unmounts.
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
exitExit—Inside a <Presence>: plays this child's way out before it unmounts.
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.