To add the ProgressTracker
component to your app:
1 2import { ProgressTracker } from '@forge/react';
A progress tracker displays the steps and progress through a journey.
Name | Type | Required | Description |
---|---|---|---|
animated | boolean | No | Turns off transition animations if set to false . |
items | Array<{ id: string; label: string; percentageComplete: number; status: 'unvisited' | 'visited' | 'current' | 'disabled'; onClick?: () => void; }> | Yes | Ordered list of stage data. |
label | string | No | Text to be used as an aria-label of progress tracker. |
spacing | "comfortable" | "cosy" | "compact" | No | Margin spacing type between steps. |
The default version of a progress tracker that shows all the steps and states in a journey.
1 2const 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", }, ]} /> ); };
The margin spacing in between the steps of a progress tracker. Box with width must be used to apply spacing.
1 2const 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> );
1 2const ProgressTrackerSpacingExample = () => ( <Box xcss={{ width: "320px" }}> <ProgressTracker items={items} spacing="cosy" /> </Box> );
1 2const ProgressTrackerSpacingExample = () => ( <Box xcss={{ width: "320px" }}> <ProgressTracker items={items} spacing="compact" /> </Box> );
A progress tracker that shows all steps have been completed.
1 2const 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', }, ]} /> ); }
When using the ProgressTracker
component, we recommend keeping the following accessibility considerations in mind:
Rate this page: