1.0.15 • Published 2 years ago

react-formzie v1.0.15

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

formzie-logo

Formzie - React Component Libray

Quick Form Builds Making Life A Little More Easy

Intro

This was a project was based and is based on one of the deliverables for openclassrooms. It then resulted into this very basic form component, with a few handy extra components.

  • Popup Modal
  • Dynamic form input field rendering
  • Custom select dropdown

End goal: To have a library that can cover those snazzy form needs and reduce those lines!

please don't confuse this with the greats that are already smashing it!

Install

npm -i react-formzie

Quick Start

1. Import formzie component

import {Formzie, InputField, Modal} from 'react-formzie'

2. Basic Implementation

import React, { useState } from 'react';
import { Formzie, InputField, Modal } from 'react-formzie';

function app() {
  const [values, setValues] = useState({});
  const [isOpen, setIsOpen] = useState(false);

  const handleOpen = () => {
    if (!isOpen) {
      setIsOpen(true);
    }
    setIsOpen(false);
  };
  const handleChange = (e) => {
    const { name, value } = e.target;
    setValues({ ...values, [name]: value });
  };

  const handleSubmit = (e) => {
    e.preventDefault();
    handleOpen();
  };

  return (
    <>
      <Formzie>
        <InputField
          controlType={'input'}
          labelHeader="First Name"
          type="text"
          idNameHtml="firstName"
          onChange={handleChange}
        />
        <InputField
          controlType={'input'}
          labelHeader="Last Name"
          type="text"
          idNameHtml="lastName"
          onChange={handleChange}
        />
        <InputField
          controlType={'submit'}
          onClick={handleSubmit}
          buttonText="Submit"
        />
      </Formzie>
      {isOpen && (
        <Modal onClick={handleOpen}>
          <p>Some Content</p>
        </Modal>
      )}
    </>
  );
}
1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago