KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
react-super-simple-wizard
★ 12
Open GitHub ↗
React wizard component
Download README (.md)
Explore Similar Repositories
youtube-react-framer-motion
:
Text Animation With Framer Motion
trendcaster
:
No description available.
near-stakewars-monitoring
:
No description available.
opentelemetry-gcloud-trace-rs
:
OpenTelemetry support for Google Cloud Trace for Rust
Weather-Prediction-NN
:
Weather conditions forecast with LSTM-CNN model
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
react-super-simple-wizard
?
Download (.md)
# React Super Simple Wizard I just get tired copy pasting it around :P [](https://github.com/5alidz/react-super-simple-wizard/blob/master/LICENSE)  ### Install ``` yarn add react-super-simple-wizard ``` ### How it works The only prop you need is `initial` the other props are completley up to you ```tsx <Wizard {/* `initial` points to a prop key */} initial='start' {/* This is named start so it will render initially */} start={({ next, prev, goto }) => ( <YourComponent onSuccess={next} /> )} theNextStep={({ goto }) => ( // now goto(stepKey: 'initial' | 'start' | 'finish') is fully typed and knows about initial, start and finish <AlsoYourComponent onSuccess={next} onError={() => goto('initial')}/> )} finish={() => ( <Confetti msg='You made it!' /> )} /> ``` ### And now, an actual useful example Imagine you have a protected resource or really any other combination of steps ```tsx import { Wizard, WizardStepProps } from 'react-super-simple-wizard'; type Step = WizardStepProps<'login' | 'register' | 'protected'>; const Login = ({ goto }: Step) => ( <LoginForm onSuccess={() => goto('protected')} /> ); const Register = ({ next }: Step) => <RegisterForm onSuccess={next} />; const Protected = () => <Dashboard />; function Auth() { return ( <Wizard initial="login" login={Login} register={Register} protected={Protected} /> ); } ```