Skip to main content

Components

Stepper

Option for your step by step user action

banner-Stepper
Square Icon

Selected Theme

Select brand or tribe name to preview style

Default

Usage

A stepper component to display step by step user action.

import { Stepper } from 'legion-ui';

Basic

Default usage of Stepper with its first step being in Step 1, and has description in its first state.

1
Step 1Desc
2
Step 2
3
Step 3
Step 4
import React from 'react';
import { Button, Stepper } from 'legion-ui';
export default function StepperExample() {
const [currentStep, setCurrentStep] = React.useState(0);
const handleNext = () => {
if (currentStep !== steps.length) {
setCurrentStep(currentStep + 1);
}
};

Props

propertypropTyperequireddefaultdescription
backgroundColorstring--The background color of each stepper items
borderColorstring--The border color of each stepper items
currentStepnumber-Sets in which step is the stepper currently in
orientationhorizontal | vertical-horizontalSets the default orientation (top to bottom or left to right) of the stepper
showTextOnright | bottomrightSets in which direction from the stepper, would the text be rendered
variantsuccess | warning | errorsuccessSets which variant of stepper would like to be rendered

Steps

propertypropTyperequireddefaultdescription
stepsArray[]-Main props should be given to the Stepper component
titlestring-Sets the title of each stepper items, should be inside label object
descriptionstring--Sets complementary description of each stepper items, should be inside label object
iconIconName from react-feather--Give the stepper item an icon, should be inside steps array.