Background
We need to implement StepIndicator component in Codex.
Description
The StepIndicator component is a combination of bullets with numbers to indicate the different steps or elements where the user can horizontally navigate. We will reuse the StepIndicator component to navigate within steps in some process dialogs like the Onboarding Dialog, as pagination in components like the Table or to represent the number of images in an Image gallery.
User stories
- As a user, I need the StepIndicator component to navigate within steps in components with different steps.
History
Describe or link to prior discussions related to this component
Known use cases
The StepIndicator component is currently being used in the Onboarding Dialog T332767 in the following use cases:
Onboarding Dialog in Growth | Onboarding Dialog in Section Translation |
Existing implementations
These artifacts are listed for historical context. The figma spec, linked below, is the source of truth for the new component.
Existing implementations:
Add any existing implementation if applicable.
External libraries:
- Add links to any examples from external libraries
Codex implementation
Component task owners
- Designer: add the main designer's name
- Developer: add the main developer's name
Open questions
- Component’s name: in order to make this component more reusable, we will rename this component from "Stepper" to "StepIndicator".
- Dots color: we will create new color tokens for the dot's colors (T339269)
- Maximum number of dots: we will implement a maximum number of visible dots as property so users can decide when to use it. We will include some recommendations in the spec about how to use this prop.
- Number’s text size: we will use the 14px text size in both desktop and mobile.
- Component’s props: we will not include the text-only prop, but might want to remove the dots when space is limited.
- Active/Completed steps: it’s not needed to visually differentiate between active and completed steps.
Design spec
Anatomy
- Text to represent the number of dots in the following format: 1 of 4
- Dots to represent the active (filled dot) and inactive (empty dots) steps
Style
- Text (on both desktop and mobile):
- 14/22 Regular: @font-size-small @line-height-small @font-family-system-sans @font-weight-normal
- color-subtle
- Step dots:
- Size @size-50 (8px)
- Colors (colors will be created in T339269):
- Active dot: background-color-step--active #202122
- Inactive dot: background-color-step--inactive #C8CCD1
Interaction
The step's dots will have the following states:
- Active: background-color-step--active #202122
- Completed (same color as active): background-color-step--active #202122
- Inactive: background-color-step--inactive #C8CCD1
Documentation
The configurable demo should include the following configurable properties:
- label: users can show/hide the text with numbers
- totalSteps: users can select the number of visible steps in the component (minimum 2 steps)
- modelValue: users can choose which is the active step
- progressType (or other name): users will select here the type of progress (linear/circular) described in the spec. We could display the linear one as default and then the circular with a ToggleSwitch
- maximum number of visible dots: we need a prop to display the max number of visible dots, since as documented in the spec, the number of visible dots can be limited to a certain number (e.g. just 5 visible dots and the rest within a scrollable smaller dot).
Other standalone demos could include:
- We need to represent the use of StepIndicator. So we could create a standalone demo using this with linear progress for OnboardingDialog and another standalone demo using it with circular progress for an Image gallery.
Acceptance criteria
Minimum viable product
This task covers the minimum viable product (MVP) version of this component. MVP includes basic layout, default states, and most important functionality.
MVP scope
- List all parts of the MVP scope for this component
Design
- Design the Figma spec sheet and add a link to it in this task
- Update the component in the Figma library. This step will be done by a DST member.
Code
- Implement the component in Codex
Future work
- If applicable, list future work that should be done for this component after the MVP is implemented as part of this task. You should open new, standalone tasks for all future work.