All Projects → sametweb → react-step-builder

sametweb / react-step-builder

Licence: MIT license
React Step Builder allows you to create step-by-step interfaces easily.

Programming Languages

typescript
32286 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-step-builder

youtube-2020-june-multi-step-form-formik
A repository with a multi-step form using Formik, Yup and Material-UI
Stars: ✭ 86 (-11.34%)
Mutual labels:  multi-step, multi-step-form
react-emotion-multi-step-form
React multi-step form library with Emotion styling
Stars: ✭ 25 (-74.23%)
Mutual labels:  forms, multi-step-form
formula-one
Strongly-typed React form state management
Stars: ✭ 66 (-31.96%)
Mutual labels:  forms
eightshift-forms
WordPress plugin project for Gutenberg forms
Stars: ✭ 23 (-76.29%)
Mutual labels:  forms
formurai
Lightweight and powerfull library for declarative form validation
Stars: ✭ 49 (-49.48%)
Mutual labels:  forms
healthgo
a android pedometer app (安卓计步器)
Stars: ✭ 32 (-67.01%)
Mutual labels:  step
angular-dynamic-forms
On-the-fly form generation from data with Angular
Stars: ✭ 21 (-78.35%)
Mutual labels:  forms
aurelia-form
Fun with forms! Form utilities to make stuff just a bit (a lot) easier.
Stars: ✭ 34 (-64.95%)
Mutual labels:  forms
ng-validators
⭐ Native angular 6+ form validators
Stars: ✭ 17 (-82.47%)
Mutual labels:  forms
p01contact
Create contact forms by writing simple tags. Also a plugin for GetSimple and Pico CMS.
Stars: ✭ 15 (-84.54%)
Mutual labels:  forms
react-formular
This libraray is an experimental approach to bind forms and its inputs and editors together using the new React Context API. It aims to be fully customizable and composable. It´s only a set of Higher-Order-Components. Because of the decoupled nature, Middlewares makes it easy to build custom Validations, Security Guards and other data interceptors.
Stars: ✭ 43 (-55.67%)
Mutual labels:  forms
ruststep
A STEP toolkit for Rust
Stars: ✭ 77 (-20.62%)
Mutual labels:  step
twig-bulma-form-theme-bundle
A Twig Form Theme for Bulma 0.3.x for use with the Symfony 2.8 / 3.x framework
Stars: ✭ 24 (-75.26%)
Mutual labels:  forms
react-search
This package will help you create a pretty good and beautiful search. And other related features
Stars: ✭ 17 (-82.47%)
Mutual labels:  forms
forms
[DEPRECATED] Form controls for Nette Framework
Stars: ✭ 50 (-48.45%)
Mutual labels:  forms
staticstep
Provides truly zero-cost alternatives to Iterator::step_by for both incrementing and decrementing any type that satisfies RangeBounds<T: Copy + Default + Step>.
Stars: ✭ 13 (-86.6%)
Mutual labels:  step
rakered
The open source components from rake.red
Stars: ✭ 28 (-71.13%)
Mutual labels:  forms
react-formulation
Simple React form validation
Stars: ✭ 14 (-85.57%)
Mutual labels:  forms
SuluFormBundle
Form Bundle for handling Dynamic and Symfony Forms in https://sulu.io
Stars: ✭ 51 (-47.42%)
Mutual labels:  forms
foxtrot
A fast, experimental STEP file viewer
Stars: ✭ 151 (+55.67%)
Mutual labels:  step

React Step Builder npm (tag) Total NPM Download

React Step Builder is a headless, unopinionated, multi-step interface builder.

Version 3 introduces some breaking changes. If you are upgrading from earlier versions, please read the documentation carefully.

Global state management methods are removed from the library. React Step Builder will only focus on building step-by-step interfaces starting from version 3. You may use a state management tool of your choice. If this is bad news for you, I am sorry 🙇‍♂️


Installation

Using npm:

npm install react-step-builder

Usage

Example:

import { Steps, StepsProvider, useSteps } from "react-step-builder";

const App = () => {
  return (
    <StepsProvider>
      <MySteps />
    </StepsProvider>
  );
};

const MySteps = () => {
  const { next, prev } = useSteps();

  return (
    <Steps>
      <div>
        <h1>Step 1</h1>
      </div>
      <div>
        <h1>Step 2</h1>
      </div>
      <div>
        <h1>Step 3</h1>
      </div>
    </Steps>
  );
};

export default App;

Documentation

<Steps />

A component whose each direct sibling is treated as a step. Do not add anything else inside Steps component as they will be treated as a separate step.

Incorrect:

<Steps>
  <Step1 />
  <Step2 />
  <NotAStep />
</Steps>

Correct:

<Steps>
  <Step1 />
  <Step2>
    <NotAStep />
  </Step2>
</Steps>

This reason for this method is due to React's composition over inheritance principle. It also allows you to manage your state easily in the parent component.

Property Type Description
onStepChange () => void Runs on every step change. Does not run on initial render.



useSteps

A special hook that accesses the state of <Steps /> component and exposes methods to move between steps.

const stepsState = useSteps();

These are the properties inside stepsState object.

Property Type Description
total number Total number of steps
current number Current step number
progress number Progress of the current step, value between 0 and 1
next () => void Function to move to the next step
prev () => void Function to move to the previous step
jump (step: number) => void Function to jump to the given step
isFirst boolean If the step is the first
isLast boolean If the step is the last
hasPrev boolean If the step has any previous step
hasNext boolean If the step has any next step



<StepsProvider />

The component that renders <Steps /> should be wrapped with StepsProvider component. useSteps can only be called in a component that is rendered in the DOM tree under StepsProvider.

Property Type Description
startsFrom number The default step number to be rendered.

Step numbers start from 1 and goes up to the count of direct siblings given to the Steps component. If the number is out of range, first step is rendered by default.




Example project: https://codesandbox.io/s/react-step-builder-v3-5625v?file=/src/App.tsx
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].