All Projects → edenriquez → svelte-multistep-form

edenriquez / svelte-multistep-form

Licence: MIT license
Svelte MultiStep Form like, this component is still in beta stage

Programming Languages

javascript
184084 projects - #8 most used programming language
Svelte
593 projects

Projects that are alternatives of or similar to svelte-multistep-form

React Form
⚛️ Hooks for managing form state and validation in React
Stars: ✭ 2,270 (+7727.59%)
Mutual labels:  forms, form
Form bloc
🔥 Dart and Flutter Package 🔥 Easy Form State Management using BLoC pattern 🔥 Wizard/stepper forms, asynchronous validation, dynamic and conditional fields, submission progress, serialization and more! 🔥
Stars: ✭ 239 (+724.14%)
Mutual labels:  forms, form
Redux Form
A Higher Order Component using react-redux to keep form state in a Redux store
Stars: ✭ 12,597 (+43337.93%)
Mutual labels:  forms, form
React Apollo Form
Build React forms based on GraphQL APIs.
Stars: ✭ 178 (+513.79%)
Mutual labels:  forms, form
react-apollo-form
Build React forms based on GraphQL APIs.
Stars: ✭ 195 (+572.41%)
Mutual labels:  forms, form
Composable Form
Build type-safe composable forms in Elm
Stars: ✭ 179 (+517.24%)
Mutual labels:  forms, form
Svelte Forms Lib
📝. A lightweight library for managing forms in Svelte
Stars: ✭ 238 (+720.69%)
Mutual labels:  forms, svelte
Sveltik
Powerful forms in Svelte, inspired by Formik.
Stars: ✭ 128 (+341.38%)
Mutual labels:  forms, svelte
Vue Form Json Schema
Create forms using JSON schema. Bring your components!
Stars: ✭ 253 (+772.41%)
Mutual labels:  forms, form
Final Form
🏁 Framework agnostic, high performance, subscription-based form state management
Stars: ✭ 2,787 (+9510.34%)
Mutual labels:  forms, form
Fielder
A field-first form library for React and React Native
Stars: ✭ 160 (+451.72%)
Mutual labels:  forms, form
ember-validity-modifier
Ember Octane addon to add custom validity (form validation) to form fields
Stars: ✭ 28 (-3.45%)
Mutual labels:  forms, form
Core
The Form Tools Core.
Stars: ✭ 156 (+437.93%)
Mutual labels:  forms, form
React Redux Form
Create forms easily in React with Redux.
Stars: ✭ 2,099 (+7137.93%)
Mutual labels:  forms, form
Reactive forms
This is a model-driven approach to handling form inputs and validations, heavily inspired in Angular's Reactive Forms
Stars: ✭ 135 (+365.52%)
Mutual labels:  forms, form
Rich Model Forms Bundle
Provides additional data mappers that ease the use of the Symfony Form component with rich models.
Stars: ✭ 198 (+582.76%)
Mutual labels:  forms, form
React Controlled Form
Flexible, Modular & Controlled Forms for React and Redux
Stars: ✭ 121 (+317.24%)
Mutual labels:  forms, form
Forms
📝 Simple form & survey app for Nextcloud
Stars: ✭ 127 (+337.93%)
Mutual labels:  forms, form
Fui
Add CLI & form interface to your program. Docs: https://docs.rs/fui
Stars: ✭ 244 (+741.38%)
Mutual labels:  forms, form
FrontendForms
A module for ProcessWire CMS to create and validate forms on the frontend easily using the Valitron library.
Stars: ✭ 0 (-100%)
Mutual labels:  forms, form

svelte multistep form NPM Version

Multi Step Form help to wrap form elements passing down styles to the component to be rendered, also it presents each form step in a ordered and stylish way.

Demo

Install

npm install svelte-multistep-form

then import into your code

import { Form, Step } from "svelte-multistep-form";

Usage

First you need to set up the form stepsDescription, formSubtitle and formTitle inside multiStepOptions that later has to be injected into Form component <Form {multiStepOptions}>

let multiStepOptions = {
  formTitle: "New Title ✍️",
  formSubtitle: "Subtitle should be here",
  stepsDescription: [
    { title: "STEP 1", subtitle: "All the details to perform on this step" },
    { title: "STEP 2", subtitle: "All the details to perform on this step" },
  ],
};

After that you only need to call Form and Step component in the following way

<form {multiStepOptions}>
  <Step> // Here should be your form </Step>
</form>

Submit form data

<script>
  import axios from "axios";
  import { Form, Step } from "svelte-multistep-form";

  let multiStepOptions = {
    formTitle: "New Title ✍️",
    formSubtitle: "Subtitle should be here",
    stepsDescription: [
      { title: "Input step", subtitle: "Input to fulfill" },
      { title: "Submit", subtitle: "Save!" },
    ],
  };
  let myInputValue;

  const handleSubmit = () => {
    const formValues = {
      firstStepInput: myInputValue,
    };
    axios.post("http://my-internal-api/submit", formValues);
    myInputValue = "";
  };
</script>

<form {multiStepOptions}>
  <Step>
    <input
      class="your-custom-class"
      id="form-field"
      bind:value="{myInputValue}"
      placeholder="value here..."
    />
  </Step>
  <Step>
    <button class="your-custom-class" on:click|preventDefault="{handleSubmit}">
      Save me
    </button>
  </Step>
</form>

Calling programatically nextStep and previousStep

<script>
let FormComponentRef;
<script/>

<Form  bind:this={FormComponentRef} >
  <Step>
     <div>
        <input
          class="my-button-class"
          type="button"
          on:click|preventDefault={() => FormComponentRef.nextStep()}
        />
      </div>
    </Step>
    <Step>
      <div>
        <input
          class="my-button-class"
          type="button"
          on:click|preventDefault={() => FormComponentRef.previousStep()}
        />
      </div>
    </Step>
</Form>

Examples

checkout /examples folder, run the following commands in order to run examples:

cd examples
npm i
npm run dev

Go to http://localhost:5000 to see it in action 🔥

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].