# ProgressCircle
**📖 Live documentation:** https://cds.coinbase.com/components/feedback/ProgressCircle/
A circular visual indicator of completion progress. Supports both determinate progress (0–100%) and an indeterminate variant for loading states.
## Import
```tsx
import { ProgressCircle } from '@coinbase/cds-web/visualizations/ProgressCircle'
```
## Examples
### Default
```jsx live
```
### Indeterminate
Use the `indeterminate` prop when progress is unknown (e.g. loading). The circle shows a spinning partial arc with no percentage text. This is the recommended replacement for the deprecated [Spinner](/components/feedback/Spinner) in loading contexts such as [IconButton](/components/inputs/IconButton) or button loading states.
When `indeterminate` is true, the default color is `fgMuted`; you can override `color` as needed. Always provide `accessibilityLabel` so screen readers announce the loading state.
#### Thickness (weight)
Indeterminate uses the same `weight` prop as determinate progress. The default is **`"normal"`** (4px stroke). Use `"thin"` (2px), `"semiheavy"` (8px), or `"heavy"` (12px) to change thickness.
```jsx live
Default (normal)
weight="thin"
weight="semiheavy"
```
#### Progress (arc length)
When `indeterminate` is true, the **`progress` prop controls the length of the visible arc** (how much of the circle is drawn), not a completion percentage. It defaults to `0.75` (a 270° arc). Override it to change the arc length—e.g. `0.5` for a half circle or `0.25` for a shorter arc.
```jsx live
progress=0.25
progress=0.5
progress=0.75 (default)
```
#### Sizes and color
```jsx live
```
### Thin
```jsx live
```
### Semiheavy
```jsx live
```
### Heavy
```jsx live
```
### No Text
```jsx live
```
### Disabled
```jsx live
```
### Colors
```jsx live
```
### Fill Parent
The progress circle can be dynamically sized to fit its parent. If you drag the browser window smaller or larger then the ProgressCircle will resize accordingly.
```jsx live
```
### Content Node Customization
You can override the default content node to display a custom node. Note that the content node is clipped to the circle.
#### With Asset
You can provide an image, such as an asset, as the content node.
```jsx live
}
weight="thin"
/>
}
weight="thin"
/>
}
weight="thin"
/>
}
weight="thin"
/>
}
weight="thin"
/>
}
weight="thin"
/>
}
weight="thin"
/>
}
weight="thin"
/>
}
weight="thin"
/>
}
weight="thin"
/>
```
#### Custom Text Color
The progress circle's default content can be customized to display a custom text color.
```jsx live
}
/>
}
/>
```
### Custom Styles
The progress circle can be customized with styles and class names.
```jsx live
40%
}
weight="semiheavy"
/>
}
/>
```
### Interactive Demo
This is for demo purposes. ProgressContainerWithButtons isn't designed for production usage.
```jsx live
{({ calculateProgress }) => (
)}
```
### Animation
By default, ProgressCircle animates progress changes. Use `disableAnimateOnMount` to skip the initial animation while still animating subsequent changes.
```tsx live
{({ calculateProgress }) => (
Normal animation
Disable animation on mount
)}
```
#### Callbacks
You can use the `onAnimationStart` and `onAnimationEnd` callbacks to track the progress of the animation.
```jsx live
function Example() {
const [animationStatus, setAnimationStatus] = React.useState('Ready');
const handleAnimationStart = useCallback(() => {
setAnimationStatus('Animating...');
}, []);
const handleAnimationEnd = useCallback(() => {
setAnimationStatus('Animation Ended');
}, []);
return (
{({ calculateProgress }) => (
Animation Status: {animationStatus}
)}
);
}
```
## Props
| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `className` | `string` | No | `-` | - |
| `classNames` | `{ root?: string; svg?: string \| undefined; circle?: string \| undefined; progress?: string \| undefined; } \| undefined` | No | `-` | Custom class names for individual elements of the ProgressCircle component |
| `color` | `Color` | No | `primary` | Custom progress color. |
| `contentNode` | `ReactNode` | No | `-` | Optional component to override the default content rendered inside the circle. |
| `disableAnimateOnMount` | `boolean` | No | `false` | Disable animation on component mount |
| `disabled` | `boolean` | No | `-` | Toggle used to show a disabled progress visualization |
| `hideContent` | `boolean` | No | `-` | Toggle used to hide the content node rendered inside the circle. |
| `hideText` | `boolean` | No | `-` | - |
| `indeterminate` | `boolean` | No | `-` | Toggle used to show an indeterminate progress circle. |
| `key` | `Key \| null` | No | `-` | - |
| `onAnimationEnd` | `(() => void)` | No | `-` | Callback fired when the progress animation ends. |
| `onAnimationStart` | `(() => void)` | No | `-` | Callback fired when the progress animation starts. |
| `progress` | `number` | No | `-` | Number between 0-1 representing the progress percentage |
| `ref` | `RefObject \| ((instance: HTMLDivElement \| null) => void) \| null` | No | `-` | - |
| `size` | `number` | No | `-` | Optional size in px for the visualization. This is useful if the visualization is used in an HStack. If this is omitted the visualization will fill the parent width or height. Since its a circular visualization it will fill the smaller of the parent width or height |
| `style` | `CSSProperties` | No | `-` | - |
| `styles` | `{ root?: CSSProperties; svg?: CSSProperties \| undefined; circle?: CSSProperties \| undefined; progress?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for individual elements of the ProgressCircle component |
| `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID |
| `weight` | `Weight` | No | `normal` | Toggle used to change thickness of progress visualization |
## Styles
| Selector | Static class name | Description |
| --- | --- | --- |
| `root` | `-` | Root element |
| `svg` | `-` | SVG element |
| `circle` | `-` | Background circle element |
| `progress` | `-` | Foreground progress circle element |