Progress - Circular

An element that shows either determinate or indeterminate progress.

Loading...

Anatomy

<Progress.Root>
  <Progress.Label />
  <Progress.ValueText />
  <Progress.Circle>
    <Progress.CircleTrack />
    <Progress.CircleRange />
  </Progress.Circle>
</Progress.Root>

Examples

Min and Max

Set min and max to change the range. The default max is 100. This example shows progress from 10 to 30.

Indeterminate

Progress is determinate by default, with value 50 and max 100. Set value to null for indeterminate progress.

Label

Add a label to give the indicator context.

Root Provider

Use RootProvider with the useProgress hook to access the state and methods from outside the component.

Guides

Styling the Circle

Set these CSS variables on Progress.Circle to control its size and thickness:

[data-progress-circle] {
  --size: 120px;
  --thickness: 10px;
}
VariableDescription
--sizeThe width and height of the circle
--thicknessThe stroke width of the circle track

API Reference

Root

Defines the <div> element.

AttributeDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior. Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

For more details, read our Composition guide.
defaultValuemin
number

The initial value of the progress bar when rendered. Use when you don't need to control the value of the progress bar.

formatOptions{ style: 'percent' }
NumberFormatOptions

The options to use for formatting the value.

id
string

The unique identifier of the machine.

ids
ElementIds

The ids of the elements in the progress bar. Useful for composition.

locale'en-US'
string

The locale to use for formatting the value.

max100
number

The maximum allowed value of the progress bar.

min0
number

The minimum allowed value of the progress bar.

onValueChange
(details: ValueChangeDetails) => void

Callback fired when the value changes.

orientation'horizontal'
'horizontal' | 'vertical'

The orientation of the element.

render
ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>

Render the part as a custom element, combining their props and behavior. Pass an element to have the part's props merged into it, or a function to control the merge yourself and read the part's state.

translations
IntlTranslations

The localized messages to use.

value
number

The controlled value of the progress bar.

AttributeDescription
[data-progress-root]<uid>
[data-max]
[data-value]The value of the item
[data-state]"indeterminate" | "loading" | "complete"
[data-orientation]The orientation of the progress
CSS VariableDescription
--percentThe percent value for the root
--radiusThe border radius value
--circumferenceThe circumference value for the root
--offsetThe offset position of the element

Circle

Defines the <svg> element.

AttributeDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior. Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

For more details, read our Composition guide.
render
ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>

Render the part as a custom element, combining their props and behavior. Pass an element to have the part's props merged into it, or a function to control the merge yourself and read the part's state.

AttributeDescription
[data-progress-circle]<uid>
[data-max]
[data-orientation]The orientation of the circle
[data-state]"indeterminate" | "loading" | "complete"

CircleRange

Defines the <circle> element.

AttributeDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior. Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

For more details, read our Composition guide.
render
ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>

Render the part as a custom element, combining their props and behavior. Pass an element to have the part's props merged into it, or a function to control the merge yourself and read the part's state.

AttributeDescription
[data-progress-circle-range]<uid>
[data-state]"indeterminate" | "loading" | "complete"

CircleTrack

Defines the <circle> element.

AttributeDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior. Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

For more details, read our Composition guide.
render
ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>

Render the part as a custom element, combining their props and behavior. Pass an element to have the part's props merged into it, or a function to control the merge yourself and read the part's state.

AttributeDescription
[data-progress-circle-track]<uid>
[data-orientation]The orientation of the circletrack

Label

Defines the <span> element.

AttributeDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior. Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

For more details, read our Composition guide.
render
ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>

Render the part as a custom element, combining their props and behavior. Pass an element to have the part's props merged into it, or a function to control the merge yourself and read the part's state.

AttributeDescription
[data-progress-label]<uid>
[data-orientation]The orientation of the label

Range

Defines the <div> element.

AttributeDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior. Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

For more details, read our Composition guide.
render
ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>

Render the part as a custom element, combining their props and behavior. Pass an element to have the part's props merged into it, or a function to control the merge yourself and read the part's state.

AttributeDescription
[data-progress-range]<uid>
[data-orientation]The orientation of the range
[data-state]"indeterminate" | "loading" | "complete"

RootProvider

Defines the <div> element.

AttributeDefaultType
value
UseProgressReturn

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior. Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

For more details, read our Composition guide.
render
ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>

Render the part as a custom element, combining their props and behavior. Pass an element to have the part's props merged into it, or a function to control the merge yourself and read the part's state.

Track

Defines the <div> element.

AttributeDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior. Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

For more details, read our Composition guide.
render
ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>

Render the part as a custom element, combining their props and behavior. Pass an element to have the part's props merged into it, or a function to control the merge yourself and read the part's state.

AttributeDescription
[data-progress-track]<uid>
[data-max]
[data-orientation]The orientation of the track
[data-state]"indeterminate" | "loading" | "complete"

ValueText

Defines the <span> element.

AttributeDefaultType
asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior. Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

For more details, read our Composition guide.
render
ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<EmptyState>

Render the part as a custom element, combining their props and behavior. Pass an element to have the part's props merged into it, or a function to control the merge yourself and read the part's state.

View

Defines the <span> element.

AttributeDefaultType
state
ProgressState

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior. Use `render` when you need the part's state: `render={(props, state) => <MyButton {...props} />}`.

For more details, read our Composition guide.
render
ReactElement<unknown, string | JSXElementConstructor<any>> | RenderFn<ProgressViewState>

Render the part as a custom element, combining their props and behavior. Pass an element to have the part's props merged into it, or a function to control the merge yourself and read the part's state.

AttributeDescription
[data-progress-view]<uid>
[data-state]"indeterminate" | "loading" | "complete"

Accessibility

Complies with the progressbar role requirements.