# ProgressBarWithFixedLabels
A ProgressBar with fixed labels at defined positions.
## Import
```tsx
import { ProgressBarWithFixedLabels } from '@coinbase/cds-web/visualizations/ProgressBarWithFixedLabels'
```
## Examples
### Label Below
```jsx live
```
### Label Beside
```jsx live
```
### Disabled
```jsx live
```
### Custom Labels
```jsx live
function Example() {
const renderStartLabelNumStr = useCallback((num) => {
return `$${num.toLocaleString()}`;
}, []);
const renderEndLabelNumStr = useCallback((num) => {
return `${num.toLocaleString()} left`;
}, []);
const renderStartLabelNum = useCallback((num, disabled) => {
return (
${num.toLocaleString()}
);
}, []);
const renderEndLabelNum = useCallback((num, disabled) => {
return (
${num.toLocaleString()} left
);
}, []);
return (
);
}
```
### Custom Styles
You can customize the appearance of the progress bar and labels using the `styles` prop.
```tsx live
{({ calculateProgress }) => (
)}
```
### Interactive Demo
This is for demo purposes. ProgressContainerWithButtons isn't designed for production usage.
```jsx live
{({ calculateProgress }) => (
)}
```
## Props
| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `className` | `string` | No | `-` | Custom class name for the progress bar with fixed labels root. |
| `classNames` | `{ root?: string; labelContainer?: string \| undefined; startLabel?: string \| undefined; endLabel?: string \| undefined; } \| undefined` | No | `-` | Custom class names for the progress bar with fixed labels. |
| `disabled` | `boolean` | No | `false` | Toggle used to show a disabled progress visualization |
| `endLabel` | `number \| { value: number; render: (num: number, disabled?: boolean \| undefined) => ReactNode; }` | No | `-` | Label that is pinned to the end of the container. If a number is used then it will format it as a percentage. |
| `labelPlacement` | `above \| below \| beside` | No | `beside` | Position of label relative to the bar |
| `startLabel` | `number \| { value: number; render: (num: number, disabled?: boolean \| undefined) => ReactNode; }` | No | `-` | Label that is pinned to the start of the container. If a number is used then it will format it as a percentage. |
| `style` | `CSSProperties` | No | `-` | Custom styles for the progress bar with fixed labels root. |
| `styles` | `{ root?: CSSProperties; labelContainer?: CSSProperties \| undefined; startLabel?: CSSProperties \| undefined; endLabel?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for the progress bar with fixed labels. |
| `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 |