A set of steppers components for you to use in your react projects.
It's only implemented Arrows stepper util now, but more steppers will be available soon. :)
The quickest way for you to use a stepper component in your project is by using a package manager to install it, and a ES6 ready environment.
npm install awesome-react-steps# oryarn add awesome-react-steps
;;//...<Arrowsmodel=steps:label: "Step one"label: "Step two"label: "Step three"current: 0/>;
- New steppers types
Intially empty and populating it later:
let model = ;model = model;
With an array of steps:
const model = label: "First step" label: "Last step" ;
With an object:
const model =steps: label: "One step" label: "Other step"current: 1;
Setting step states
// You can set the current step state using these functionsmodel = model;model = model;model = model;// You can also set it directlymodel = model;
Moving throw steps
/// You can move around using these functionsmodel = modelnext;model = modelprevious;// You can also set the current step directlymodel = model;
// The following states are availableStepStateUNTOUCHED;StepStateDONE;StepStateSKIPPED;StepStateINVALID;
These states are used by each stepper for rendering. Not all steppers will use all these states when rendering. But in your custom styles you can render steps using their states.
The classes used for each part of the stepper:
/* The root element of the Arrows stepper. The background should be customized in this class. *//* The element which holds a step *//* The SVG element used to draw the arrow in the background of each step *//* The elements for the number and the label of each step */
The classes for the states of the stepper. You can combine these one with the classes of the stepper parts to custom the rendering style for different states of the stepper.
/* Current step *//* Steps before the current step *//* Steps after the current step *//* Invalid step *//* Step is done *//* Step was skipped */
Open an issue if you encounter a bug or want some new feature. We will apreciate if you write us some pull requests too.