@igloo-ui/stepper
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published

Stepper

The Stepper component provides a visual representation of a multi-step process.

Installation

To install @igloo-ui/stepper in your project, you will need to run the following command using npm:

npm install @igloo-ui/stepper

If you prefer Yarn, use the following command instead:

yarn add @igloo-ui/stepper

Usage

Then to use the component in your code just import it!

import Button from '@igloo-ui/button';
import Stepper from '@igloo-ui/stepper';

const [currentStep, setCurrentStep] = React.useState(0);
const exampleSteps = [
  { title: 'Step 1', onClick: (index) => setCurrentStep(index) },
  { title: 'Step 2', onClick: (index) => setCurrentStep(index) },
  { title: 'Step 3', onClick: (index) => setCurrentStep(index) },
];

<Stepper
  currentStep={currentStep}
  style={{ flex: '1 1 auto' }}
  steps={exampleSteps}
/>
<Button
  onClick={() => setCurrentStep((prevCurrentStep) => prevCurrentStep + 1)}
  disabled={currentStep === exampleSteps.length - 1}
>
  Continue
</Button>;

Readme

Keywords

none

Package Sidebar

Install

npm i @igloo-ui/stepper

Weekly Downloads

39

Version

0.5.1

License

Apache-2.0

Unpacked Size

1.79 MB

Total Files

8

Last publish

Collaborators

  • infra.admin