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

0.1.4 • Public • Published

@availity/mui-stepper

Availity MUI Stepper component to be used with @availity/element design system.

Version NPM Downloads Dependency Status

Documentation

This package extends the MUI Stepper component: MUI Stepper Docs

Live demo and documentation in our Storybook

Availity standards for design and usage can be found in the Availity Design Guide

Installation

Import Through @availity/element (Recommended)

NPM

npm install @availity/element

Yarn

yarn add @availity/element

Direct Import

NPM

This package has a few peer dependencies. Add @mui/material & @emotion/react to your project if not already installed.

npm install @availity/mui-stepper

Yarn

yarn add @availity/mui-stepper

Usage

Import through @availity/element

import { Stepper } from '@availity/element';

Direct import

import { Stepper } from '@availity/mui-stepper';

Simple Stepper

import { useState } from 'react';
import { Stepper, Step, StepLabel } from '@availity/element';

const steps = ['Step 1', 'Step 2', 'Step 3'];

const Example = () => {
  const [activeStep, setActiveStep] = useState(0);

  const handleBack = () => {
    setActiveStep((prevActiveStep) => prevActiveStep - 1);
  };

  const handleNext = () => {
    setActiveStep((prevActiveStep) => prevActiveStep + 1);
  };

  return (
    <>
      <Stepper activeStep={0}>
        {steps.map((label, index) => {
          return (
            <Step key={label}>
              <StepLabel>{label}</StepLabel>
            </Step>
          );
        })}
      </Stepper>
      <Button color="secondary" disabled={activeStep === 0} onClick={handleBack} sx={{ mr: 1 }}>
        Back
      </Button>
      <Button color={activeStep === steps.length - 1 ? 'primary' : 'secondary'} onClick={handleNext}>
        {activeStep === steps.length - 1 ? 'Finish' : 'Next'}
      </Button>
    </>
  );
};

Package Sidebar

Install

npm i @availity/mui-stepper

Weekly Downloads

32

Version

0.1.4

License

MIT

Unpacked Size

24.6 kB

Total Files

28

Last publish

Collaborators

  • lauroxx
  • dznjudo
  • availity-cicd-bot
  • azeigler
  • dnoler
  • jselden
  • cbaker1
  • twarner
  • gregmartdotin
  • hnicbaker
  • chrishavekost
  • jordan-a-young