0.1.13 • Published 4 years ago

react-steps-wizard v0.1.13

Weekly downloads
62
License
-
Repository
github
Last release
4 years ago

react-steps-wizard

Installation:

npm i react-steps-wizard -S or using Yarn: yarn add react-steps-wizard

Props:

Stepper Component

PropTypeDescriptionDefault
activeIndexNumberThe current index of the step0
iconSizeStringSet the size the wizard's steps icons, could be small, medium or largemedium
directionStringThe Direction of the stepper wizard, could be either horizontal or verticalhorizontal
hasErrorBooleanSet an error icon on the step which the currentIndex representfalse
empLinesBooleanemphasize the lines between the checked stepstrue

Step Component

PropTypeDescriptionDefault
titleString | ReactNodeTitle of a step
subtitleString | ReactNodeSubtitle of a step
markString | ReactNodea kind of badge to add which will be shown on the top right of the step

Usage:

  import React from "react";
  import ReactDOM from "react-dom";
  import {Stepper, Step} from 'react-steps-wizard';

  function App() {
  
      const [current, setCurrent] = React.useState(0);
  
      const changeStep = direction => {
          setCurrent(current => current + (direction === 'next' ? 1 : -1));
      }
  
      return (
          <>
              <Stepper activeIndex={current} iconSize="large">
                  <Step title="Intro" subtitle="who we are" />
                  <Step title="Personal Details"  />
                  <Step title="Expectations" subtitle="what you expect from us" />
              </Stepper>
  
              <div>
                  <button onClick={() => changeStep('back')}>Back</button>
                  <button onClick={() => changeStep('next')}>Next</button>
              </div>
          </>
      );
  }

  ReactDOM.render(<App />, document.getElementById("root"));
0.1.13

4 years ago

0.1.10

4 years ago

0.1.11

4 years ago

0.1.12

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago