# Progress indicator
URL: /docs/vuecomponents/progress-indicator

The Progress Indicator is a component that shows the user the steps they need to take to complete a form.





<JobPositions />

## Installation [#installation]

<CodeBlockTabs defaultValue="npm">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="npm">
      npm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pnpm">
      pnpm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="yarn">
      yarn
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="bun">
      bun
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="npm">
    ```bash
    npm i @tryg/vue-ui-library
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pnpm">
    ```bash
    pnpm add @tryg/vue-ui-library
    ```
  </CodeBlockTab>

  <CodeBlockTab value="yarn">
    ```bash
    yarn add @tryg/vue-ui-library
    ```
  </CodeBlockTab>

  <CodeBlockTab value="bun">
    ```bash
    bun add @tryg/vue-ui-library
    ```
  </CodeBlockTab>
</CodeBlockTabs>

## Usage [#usage]

<VuePlayground
  code="<template>
  <anchor-progress-indicator current-index=&#x22;2&#x22; style=&#x22;width: 100%;&#x22;>
    <anchor-progress-indicator-step label=&#x22;Step 1&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 2&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 3&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 4&#x22;></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>"
  components="AnchorProgressIndicator:AnchorProgressIndicatorStep"
/>

<Tabs items="['Individual', 'Plugin']">
  <Tab value="Plugin">
    Install the component library as a Vue plugin. This globally registers all Anchor components.

    ```vue title="main.js"
    import { createApp } from 'vue';
    import { ComponentLibrary } from '@tryg/vue-ui-library';
    import App from './App.vue';

    const app = createApp(App);
    app.use(ComponentLibrary);
    app.mount('#app');
    ```

    ```vue title="YourComponent.vue"
    <template>
      <anchor-progress-indicator current-index="2">
        <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
        <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
        <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
        <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
      </anchor-progress-indicator>
    </template>
    ```
  </Tab>

  <Tab value="Individual">
    Import only the components you need for optimal bundle size.

    ```vue title="YourComponent.vue"
    <script setup>
    import { AnchorProgressIndicator, AnchorProgressIndicatorStep } from '@tryg/vue-ui-library';
    </script>
    <template>
      <anchor-progress-indicator current-index="2">
        <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
        <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
        <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
        <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
      </anchor-progress-indicator>
    </template>
    ```
  </Tab>
</Tabs>

The Progress Indicator is a component that shows the user the steps they need to take to complete a form.
It is a visual representation of the steps in a process, and it can be used to guide the user through a form or to show the user how far they have come in a survey.

### Dynamic current step [#dynamic-current-step]

Use Vue's `ref` to dynamically update the current step.

<VuePlayground
  code="<script setup>
import { ref } from 'vue';
const currentIndex = ref(0);
</script>
<template>
  <div style=&#x22;width: 100%;&#x22;>
    <anchor-progress-indicator :current-index=&#x22;currentIndex&#x22;>
      <anchor-progress-indicator-step label=&#x22;Step 1&#x22;></anchor-progress-indicator-step>
      <anchor-progress-indicator-step label=&#x22;Step 2&#x22;></anchor-progress-indicator-step>
      <anchor-progress-indicator-step label=&#x22;Step 3&#x22;></anchor-progress-indicator-step>
      <anchor-progress-indicator-step label=&#x22;Step 4&#x22;></anchor-progress-indicator-step>
    </anchor-progress-indicator>
    <anchor-button variant=&#x22;primary&#x22; color=&#x22;brand&#x22; @click=&#x22;currentIndex = 2&#x22;>Go to Step 3</anchor-button>
  </div>
</template>"
  components="AnchorProgressIndicator:AnchorProgressIndicatorStep:AnchorButton"
/>

```vue
<script setup>
import { ref } from 'vue';
const currentIndex = ref(0);
</script>
<template>
  <div style="width: 100%;">
    <anchor-progress-indicator :current-index="currentIndex">
      <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
      <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
      <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
      <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
    </anchor-progress-indicator>
    <anchor-button variant="primary" color="brand" @click="currentIndex = 2">Go to Step 3</anchor-button>
  </div>
</template>
```

### Alternative labels [#alternative-labels]

<VuePlayground
  code="<template>
  <anchor-progress-indicator current-index=&#x22;2&#x22; alt-labels style=&#x22;width: 100%;&#x22;>
    <anchor-progress-indicator-step label=&#x22;Step 1&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 2&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 3&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 4&#x22;></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>"
  components="AnchorProgressIndicator:AnchorProgressIndicatorStep"
/>

```vue
<template>
  <anchor-progress-indicator current-index="2" alt-labels>
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>
```

### Hide labels [#hide-labels]

<VuePlayground
  code="<template>
  <anchor-progress-indicator current-index=&#x22;2&#x22; hide-labels style=&#x22;width: 100%;&#x22;>
    <anchor-progress-indicator-step label=&#x22;Step 1&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 2&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 3&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 4&#x22;></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>"
  components="AnchorProgressIndicator:AnchorProgressIndicatorStep"
/>

```vue
<template>
  <anchor-progress-indicator current-index="2" hide-labels>
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>
```

### Is advancing [#is-advancing]

<VuePlayground
  code="<template>
  <anchor-progress-indicator current-index=&#x22;2&#x22; is-advancing style=&#x22;width: 100%;&#x22;>
    <anchor-progress-indicator-step label=&#x22;Step 1&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 2&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 3&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 4&#x22;></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>"
  components="AnchorProgressIndicator:AnchorProgressIndicatorStep"
/>

```vue
<template>
  <anchor-progress-indicator current-index="2" is-advancing>
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>
```

### Is continuing [#is-continuing]

<VuePlayground
  code="<template>
  <anchor-progress-indicator current-index=&#x22;2&#x22; is-continuing style=&#x22;width: 100%;&#x22;>
    <anchor-progress-indicator-step label=&#x22;Step 1&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 2&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 3&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 4&#x22;></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>"
  components="AnchorProgressIndicator:AnchorProgressIndicatorStep"
/>

```vue
<template>
  <anchor-progress-indicator current-index="2" is-continuing>
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>
```

### Small [#small]

<VuePlayground
  code="<template>
  <anchor-progress-indicator current-index=&#x22;2&#x22; size=&#x22;small&#x22; style=&#x22;width: 100%;&#x22;>
    <anchor-progress-indicator-step label=&#x22;Step 1&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 2&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 3&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 4&#x22;></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>"
  components="AnchorProgressIndicator:AnchorProgressIndicatorStep"
/>

```vue
<template>
  <anchor-progress-indicator current-index="2" size="small">
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>
```

### Vertical orientation [#vertical-orientation]

<VuePlayground
  code="<template>
  <anchor-progress-indicator current-index=&#x22;2&#x22; orientation=&#x22;vertical&#x22;>
    <anchor-progress-indicator-step label=&#x22;Step 1&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 2&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 3&#x22;></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label=&#x22;Step 4&#x22;></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>"
  components="AnchorProgressIndicator:AnchorProgressIndicatorStep"
/>

```vue
<template>
  <anchor-progress-indicator current-index="2" orientation="vertical">
    <anchor-progress-indicator-step label="Step 1"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 2"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 3"></anchor-progress-indicator-step>
    <anchor-progress-indicator-step label="Step 4"></anchor-progress-indicator-step>
  </anchor-progress-indicator>
</template>
```

## Accessibility [#accessibility]

* Uses a `<nav>` element with `aria-label="progress"` to create a navigation landmark for the step indicator.
* The active step is indicated using `aria-current="step"`, allowing screen readers to announce the user's current position in the flow.
* Dividers between steps use `role="separator"` with `aria-orientation` matching the component orientation (horizontal or vertical).
* The `current-index` prop controls which step is announced as active, keeping screen reader users oriented within the process.
* The `alt-labels` and `hide-labels` props allow customization of the labels exposed to assistive technology.

## API [#api]

### Progress indicator [#progress-indicator]

# anchor-progress-indicator [#anchor-progress-indicator]

<!-- Auto Generated Below -->

## Properties [#properties]

| Property       | Attribute       | Description                                             | Type                         | Default        |
| -------------- | --------------- | ------------------------------------------------------- | ---------------------------- | -------------- |
| `altLabels`    | `alt-labels`    | Use alternative labels for the steps                    | `boolean`                    | `false`        |
| `currentIndex` | `current-index` | Which index is this step in the progress indicator      | `number`                     | `0`            |
| `hideLabels`   | `hide-labels`   | Hide the labels for the steps                           | `boolean`                    | `false`        |
| `isAdvancing`  | `is-advancing`  | Is advancing the progress indicator flow                | `boolean`                    | `false`        |
| `isContinuing` | `is-continuing` | Is continuing the progress indicator flow               | `boolean`                    | `false`        |
| `orientation`  | `orientation`   | Orientation of the progress-indicator component         | `"horizontal" \| "vertical"` | `'horizontal'` |
| `size`         | `size`          | Size of the progress-indicator component and it's steps | `"normal" \| "small"`        | `'normal'`     |

## Dependencies [#dependencies]

### Depends on [#depends-on]

* [anchor-label](../label)

### Graph [#graph]

```mermaid
graph TD;
  anchor-progress-indicator --> anchor-label
  style anchor-progress-indicator fill:#f9f,stroke:#333,stroke-width:4px
```

***

*Built with [StencilJS](https://stenciljs.com/)*

### Progress indicator step [#progress-indicator-step]

# anchor-progress-indicator-step [#anchor-progress-indicator-step]

<!-- Auto Generated Below -->

## Properties [#properties-1]

| Property      | Attribute     | Description                                        | Type                         | Default      |
| ------------- | ------------- | -------------------------------------------------- | ---------------------------- | ------------ |
| `active`      | `active`      | Is this step active                                | `boolean`                    | `false`      |
| `altLabels`   | `alt-labels`  | Use alternative labels for the step                | `boolean`                    | `false`      |
| `completed`   | `completed`   | Is this step complete                              | `boolean`                    | `false`      |
| `disabled`    | `disabled`    | Is this step disabled                              | `boolean`                    | `false`      |
| `hideLabels`  | `hide-labels` | Hide the label for the step                        | `boolean`                    | `false`      |
| `index`       | `index`       | Which index is this step in the progress indicator | `number`                     | `0`          |
| `isFirst`     | `is-first`    | Is this the first step                             | `boolean`                    | `false`      |
| `isLast`      | `is-last`     | Is this the last step                              | `boolean`                    | `false`      |
| `label`       | `label`       | Label for the step                                 | `string`                     | `undefined`  |
| `orientation` | `orientation` | Orientation of the step component                  | `"horizontal" \| "vertical"` | `'vertical'` |
| `size`        | `size`        | Size of the step component                         | `"normal" \| "small"`        | `'normal'`   |

## Events [#events]

| Event   | Description | Type               |
| ------- | ----------- | ------------------ |
| `click` |             | `CustomEvent<any>` |

## Dependencies [#dependencies-1]

### Depends on [#depends-on-1]

* [anchor-icon](../icon)
* [anchor-label](../label)

### Graph [#graph-1]

```mermaid
graph TD;
  anchor-progress-indicator-step --> anchor-icon
  anchor-progress-indicator-step --> anchor-label
  style anchor-progress-indicator-step fill:#f9f,stroke:#333,stroke-width:4px
```

***

*Built with [StencilJS](https://stenciljs.com/)*
