UI Kit 2 components
UI Kit 2 hooks
Product bridge APIs
Jira bridge APIs
Upgrade to latest UI Kit 2
Previous versions

Progress tracker

To add the ProgressTracker component to your app:

1
2
import { ProgressTracker } from '@forge/react';

Description

A progress tracker displays the steps and progress through a journey.

Props

NameTypeRequiredDescription
animatedbooleanNoTurns off transition animations if set to false.
itemsArray<{ id: string; label: string; percentageComplete: number; status: 'unvisited' | 'visited' | 'current' | 'disabled'; onClick?: () => void; }>YesOrdered list of stage data.
labelstringNoText to be used as an aria-label of progress tracker.
spacing"comfortable" | "cosy" | "compact"NoMargin spacing type between steps.

Examples

Default

The default version of a progress tracker that shows all the steps and states in a journey.

Example image of a progress tracker

1
2
const ProgressTrackerExample = () => {
  return (
    <ProgressTracker
      items={[
        {
          id: "1",
          label: "Disabled step",
          percentageComplete: 100,
          status: "disabled",
        },
        {
          id: "2",
          label: "Create a space",
          percentageComplete: 100,
          status: "visited",
        },
        {
          id: "3",
          label: "Upload a photo",
          percentageComplete: 0,
          status: "current",
        },
        {
          id: "4",
          label: "Your details",
          percentageComplete: 0,
          status: "unvisited",
        },
        {
          id: "5",
          label: "Invite users",
          percentageComplete: 0,
          status: "unvisited",
        },
        {
          id: "6",
          label: "Confirm",
          percentageComplete: 0,
          status: "unvisited",
        },
      ]}
    />
  );
};

Spacing

The margin spacing in between the steps of a progress tracker. Box with width must be used to apply spacing.

Comfortable

Example image of comfortable progress tracker

1
2
const items = [
  {
    id: "1",
    label: "Disabled step",
    percentageComplete: 100,
    status: "disabled",
  },
  {
    id: "2",
    label: "Create a space",
    percentageComplete: 100,
    status: "visited",
  },
  {
    id: "3",
    label: "Upload a photo",
    percentageComplete: 0,
    status: "current",
  },
  {
    id: "4",
    label: "Your details",
    percentageComplete: 0,
    status: "unvisited",
  },
    {
    id: "5",
    label: "Invite users",
    percentageComplete: 0,
    status: "unvisited",
  },
  {
    id: "6",
    label: "Confirm",
    percentageComplete: 0,
    status: "unvisited",
  },
];

const ProgressTrackerSpacingExample = () => (
  <Box xcss={{ width: "320px" }}>
    <ProgressTracker items={items} spacing="comfortable" />
  </Box>
);

Cosy (default)

Example image of cosy progress tracker

1
2
const ProgressTrackerSpacingExample = () => (
  <Box xcss={{ width: "320px" }}>
    <ProgressTracker items={items} spacing="cosy" />
  </Box>
);

Compact

Example image of compact progress tracker

1
2
const ProgressTrackerSpacingExample = () => (
  <Box xcss={{ width: "320px" }}>
    <ProgressTracker items={items} spacing="compact" />
  </Box>
);

Completed

A progress tracker that shows all steps have been completed.

Example image of compact progress tracker

1
2
const ProgressTrackerCompletedExample = () => {
  return ( 
    <ProgressTracker items={[
      {
        id: '1',
        label: 'Disabled step',
        percentageComplete: 100,
        status: 'disabled',
      },
      {
        id: '2',
        label: 'Create a space',
        percentageComplete: 100,
        status: 'visited',
      },
      {
        id: '3',
        label: 'Upload a photo',
        percentageComplete: 100,
        status: 'visited',
      },
      {
        id: '4',
        label: 'Your details',
        percentageComplete: 100,
        status: 'visited',
      },
      {
        id: '5',
        label: 'Invite users',
        percentageComplete: 100,
        status: 'visited',
      },
      {
        id: '6',
        label: 'Confirm',
        percentageComplete: 0,
        status: 'current',
      },
    ]} />
  );
}

Accessibility considerations

When using the ProgressTracker component, we recommend keeping the following accessibility considerations in mind:

  • Use labels that clearly indicate the purpose of the step. When writing, keep options to a single line of text, be short and concise (1-2 words).
  • If a task needs more than six steps, consider simplifying the process or breaking it up into multiple tasks.

Rate this page: