---
title: Progress
---

import LibraryInfo from '@theme/LibraryInfo'
import { Feedback, TokensTable, PropsTable } from '../../src/components'
import { Progress, Box } from '@telus-uds/components-web'
import { Progress as BaseDocs } from 'docs/@telus-uds/components-base'
import AvailableOnBoth from '../../partials/_platform-considerations-both.mdx'

# Progress

<LibraryInfo figmaLink="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2F4zJn2Qn6uXOqPP1GVDipy6%2F%25F0%259F%258D%2580-Allium-Components%3Fnode-id%3D883%253A6650" />

```jsx live
<Progress>
  <Progress.Bar percentage={75} accessibilityLabel="Progress bar" />
</Progress>
```

## Introduction

Progress component is a container for displaying one or several `Progress.Bar`s.

[Follow the appropriate instructions](importing-components) to add this component in to your app.

### Accessibility

Both Progress and its child Progress.Bar components accept the standard [React Native
accessibility props](https://reactnative.dev/docs/accessibility), but these usually
don't need to be provided.

The crucial accessibility props are set within Progress.Bar, and defaults are automatically
provided as follows:

- `accessibilityRole` (`role`): `progressbar`,
- `accessibilityValue.min` (`aria-valuemin`): `0`,
- `accessibilityValue.max` (`aria-valuemax`): `100`,
- `accessibilityValue.now` (`aria-valuenow`): `percentage`,
- `accessibilityValue.text` (`aria-valuetext`): `%{percentage}%`

If necessary, these may be overridden by passing these props to Progress.Bar, but for
the majority of cases, it automatically generates the expected values for assistive
technology to correctly describe the progress bar's current state.

### Platform considerations

<AvailableOnBoth />

However, keep in mind that appearance may slightly differ among platforms.

## Props

### Progress

<PropsTable base={BaseDocs} />

### Progress.Bar

<PropsTable base={BaseDocs.Bar} />

## Tokens

<TokensTable base={BaseDocs} component="Progress" />

## Variants

:::warning
Note: `{ inactive: true }` & `{ negative: true }` are deprecated and will be removed in the future. Please consider using `{ style: 'inactive' }`, `{ style: 'negative' }` to achieve the same outcome.
:::

- Use `{ size: 'mini' }` in the `variant` prop of the Progress component for a narrower progress bar container.
- Use `{ inactive: true }` in the `variant` prop of the Progress.Bar component for a filling corresponding to
  the disabled state.
- `{ negative: true }` variant of the Progress.Bar component for negative / secondary filling.

```jsx live
<Progress variant={{ size: 'mini' }}>
  <Progress.Bar percentage={75} accessibilityLabel="Progress bar" />
  <Progress.Bar
    percentage={50}
    accessibilityLabel="Negative progress bar"
    variant={{ negative: true }}
  />
  <Progress.Bar
    percentage={25}
    accessibilityLabel="Inactive progress bar"
    variant={{ inactive: true }}
  />
</Progress>
```

### Subtle

- Use `subtle` variant `style` that is visually neutral that is neither positive or negative.

```jsx live
<Box variant={{ background: 'darkest' }} space={3}>
  <Progress>
    <Progress.Bar
      percentage={50}
      variant={{ style: 'subtle' }}
      accessibilityLabel="Subtle progress bar"
    />
  </Progress>
</Box>
```

### Inverse

- Use the `inverse` variant `style` to appear on darker backgrounds.

```jsx live
<Box variant={{ background: 'darkest' }} space={3}>
  <Progress variant={{ style: 'inverse' }}>
    <Progress.Bar
      percentage={50}
      variant={{ style: 'inverse' }}
      accessibilityLabel="Inverse progress bar"
    />
  </Progress>
</Box>
```

### Negative

```jsx live
<Progress>
  <Progress.Bar
    percentage={50}
    variant={{ style: 'negative' }}
    accessibilityLabel="Negative progress bar"
  />
</Progress>
```

### Inactive

- Use the `inactive` variant (not functionally disabled or visually low-contrast).

```jsx live
<Progress>
  <Progress.Bar
    percentage={50}
    variant={{ style: 'inactive' }}
    accessibilityLabel="Inactive progress bar"
  />
</Progress>
```

### Offset position

To set an offset for the progress bar, use the `offset` object prop, specifying the total number of `items` and the current `item` of `ProgressBar` position.

- `items`: total number of items in the progress bar.
- `current`: current item in the progress bar.
- If an invalid number is provided for `items`, a `percentage` value will be used as a fallback.
- If `current` is less than 1, the progress will default to 1.
- If `current` is greater than `items`, the `current` will default to the total number of `items`.

```jsx live
<Progress>
  <Progress.Bar
    percentage={50}
    offset={{
      items: 5,
      current: 2
    }}
    accessibilityLabel="Progress bar with offset position"
  />
</Progress>
```

## Feedback

<Feedback component="Progress" />
