Skip to main content

Stepper

Stepper tool is used to enlighten user regarding the progress of the task. Stepper component displays the progress of the task in a sequence of numbered steps through Step component.

import { Stepper } from "rizzui";

Simple Stepper

A simple stepper with component Stepper and Step.

1

Step 1

This is a description
2

Step 2

This is a description
3

Step 3

This is a description
import { Stepper } from "rizzui";

export default function App() {
return (
<Stepper>
<Stepper.Step title="Step 1" description="This is a description" />
<Stepper.Step title="Step 2" description="This is a description" />
<Stepper.Step title="Step 3" description="This is a description" />
</Stepper>
);
}

With Outline Variant

You can use outline variant with Stepper.

1

Step 1

This is a description
2

Step 2

This is a description
3

Step 3

This is a description
import { Stepper } from "rizzui";

export default function App() {
return (
<Stepper dot currentIndex={1}>
<Stepper.Step
variant="outline"
color="primary"
title="Step 1"
description="This is a description"
/>

<Stepper.Step
variant="outline"
color="primary"
title="Step 2"
description="This is a description"
/>

<Stepper.Step
variant="outline"
color="primary"
title="Step 3"
description="This is a description"
/>
</Stepper>
);
}

With Custom Icons

You can use custom icon inside Stepper and Step.

Login

Verification

Pay

Done

import { Stepper } from "rizzui";

export default function App() {
return (
<Stepper currentIndex={2} className="w-full">
<Stepper.Step
variant="outline"
title="Login"
icon={<UserIcon className="h-5 w-5" />}
/>
<Stepper.Step
variant="outline"
title="Verification"
icon={<DocumentMagnifyingGlassIcon className="h-5 w-5" />}
/>
<Stepper.Step
variant="outline"
title="Pay"
icon={<CreditCardIcon className="h-5 w-5" />}
/>
<Stepper.Step
variant="outline"
title="Done"
icon={<FaceSmileIcon className="h-5 w-5" />}
/>
</Stepper>
);
}

With Colors

You can use colors with Stepper.

Step 1

This is a description
2

Step 2

This is a description
3

Step 3

This is a description
import { Stepper } from "rizzui";

export default function App() {
return (
<Stepper>
<Stepper.Step description="This is a description" title="Step 1" />
<Stepper.Step description="This is a description" title="Step 2" />
<Stepper.Step description="This is a description" title="Step 3" />
</Stepper>
);
}

With Error Message Step

You can use error step with Step component.

Step 1

This is a description

Step 2

This is a description
3

Step 3

This is a description
import { Stepper } from "rizzui";

export default function App() {
return (
<Stepper currentIndex={1}>
<Stepper.Step title="Step 1" description="This is a description" />

<Stepper.Step
status="error"
color="danger"
title="Step 2"
description="This is a description"
/>

<Stepper.Step title="Step 3" description="This is a description" />
</Stepper>
);
}

With Functional

You can use functional with Stepper and Step.

1

Step 1

This is a description
2

Step 2

This is a description
3

Step 3

This is a description
import React from "react";
import { Stepper, Button } from "rizzui";

export default function App() {
const [currentStep, setCurrentStep] = React.useState(0);
return (
<>
<Stepper currentIndex={currentStep}>
<Stepper.Step title="Step 1" description="This is a description" />
<Stepper.Step title="Step 2" description="This is a description" />
<Stepper.Step title="Step 3" description="This is a description" />
</Stepper>

<div className="mt-7 flex space-x-4">
<Button
disabled={currentStep === 3}
onClick={() => setCurrentStep(currentStep + 1)}
>
Next
</Button>

{currentStep === 3 && (
<Button onClick={() => setCurrentStep(0)}>Reset</Button>
)}
</div>
</>
);
}

API Reference


Stepper Props

Here is the API documentation of the Stepper component. You can use the following props to create a Stepper.

PropsTypeDescriptionDefault
currentIndexnumberIndex of currently active step0
directionStepperDirectionsDirection of stepper"horizontal"
dotbooleanWhether to show dotfalse
childrenReactNodePass Step Component as children__

Stepper Directions

type StepperDirection = "vertical" | "horizontal";

Step Props

Here is the API documentation of the Step component. You can use the following props to create a Step.

PropsTypeDescriptionDefault
titleReactNodeGive a title for the step__
descriptionReactNodeGive a description for the step__
iconReactNodePass custom icon__
indexnumberIndex number for each component. Handled underneath by Stepper component0
statusStepStatusStatus of each step__
sizeStepSizesThe size of each Step"md"
variantStepVariantsThe variants of the component"solid"
colorStepColorsChange Step Color"primary"
dotbooleanWhether to show dot. Handled from Stepper component__
classNamestringPass className to design the container__
circleClassNamestringPass circleClassName to design the rounded disc__
contentClassNamestringPass contentClassName to design the content__
titleClassNamestringPass titleClassName to design the label or title of the step__
descriptionClassNamestringPass descriptionClassName to design the description of the step__

Step Status

type StepStatus = "error" | "waiting" | "in-progress" | "completed";

Step Sizes

type StepSizes = "sm" | "md" | "lg";

Step Variants

type StepVariants = "solid" | "outline";

Step Colors

type StepColors =
| "primary"
| "secondary"
| "danger"
| "info"
| "success"
| "warning";