# ProgressBar **📖 Live documentation:** https://cds.coinbase.com/components/feedback/ProgressBar/ A visual indicator of completion progress. ## Import ```tsx import { ProgressBar } from '@coinbase/cds-web/visualizations/ProgressBar' ``` ## Examples #### Default ```tsx live ``` #### Weights ```tsx live ``` #### Disabled ```tsx live ``` #### Colors ```tsx live ``` #### Custom Styles You can customize the appearance of the progress bar using the `styles` prop. The `root` style controls the container, and `progress` controls the fill bar. ```tsx live ``` #### Interactive Demo This is for demo purposes. ProgressContainerWithButtons isn't designed for production usage. ```tsx live {({ calculateProgress }) => ( )} ``` ### Animation By default, ProgressBar 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; progress?: string \| undefined; } \| undefined` | No | `-` | Custom class names for individual elements of the ProgressBar component | | `color` | `Color` | No | `primary` | Custom progress color. | | `disableAnimateOnMount` | `boolean` | No | `false` | Disable animation on component mount | | `disabled` | `boolean` | No | `-` | Toggle used to show a disabled progress visualization | | `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 | `-` | - | | `style` | `CSSProperties` | No | `-` | - | | `styles` | `{ root?: CSSProperties; progress?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for individual elements of the ProgressBar 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 | | `progress` | `-` | Progress fill element |