react-simple-step-wizard 🧙
A simple and composable step wizard in React! Made with ❤ in El Salvador 🇸🇻
react-simple-step-wizard demo
Demo
Click here to see a live demo!
Getting Started
Installation
npm install -S react-simple-step-wizard
Usage
;; const Step1 = <div>This is Step 1</div>;const Step2 = <div>This is Step 2</div>;const Step3 = <div>This is Step 3</div>;const Step4 = <div>This is Step 4</div>;const Step5 = <div>This is Step 5</div>;const Step6 = <div>This is Step 6</div>;const MyStepTracker = <div> <p>Current step is: stepscurrentStep</p> </div>;const MyNavigator = getFirstStepProps getLastStepProps getNextStepProps getPrevStepProps <div> <button type="button" ...> << First </button> <button type="button" ...> < Back </button> <button type="button" ...> Next > </button> <button type="button" ...> Last >> </button> </div>; state = isCustomizeVisible: true ; { console; }; { this; }; { const isCustomizeVisible = thisstate; return <div> <h1>react-simple-step-wizard demo</h1> <div> <p>Step 3 visible: isCustomizeVisible</p> <button type="button" onClick=thisonClick> Toggle Step 3 </button> </div> <Wizard onStepChange=thishandleStepChange> <WizardStepTracker /> <WizardSteps> <Step1 stepLabel="Search" /> <Step2 stepLabel="Select" /> <Step3 stepLabel="Customize" stepCondition=isCustomizeVisible /> <Step4 stepLabel="Review" /> <WizardStepGroup stepLabel="Submit"> <Step5 /> <Step6 /> </WizardStepGroup> </WizardSteps> /* You can implement your custom components via render-props */ <WizardStepTracker> <MyStepTracker ...stepTrackerProps /> </WizardStepTracker> <WizardNavigator> <MyNavigator ...navigatorProps /> </WizardNavigator> </Wizard> </div> ; } ;
Roadmap
V1
Provide an accessible and composable API to be used with older react versions that don't support hooks.
V2
Rewrite lib core and expose some of the APIs using react hooks.
License
MIT © jonathanpalma