1.1.0 • Published 5 years ago

react-kb-form v1.1.0

Weekly downloads
318
License
ISC
Repository
github
Last release
5 years ago

react-kb-form

Form validation hook library for enterprise scale react applications

Installation

Use the package manager npm to install react-kb-form.

npm i react-kb-form

Features

  • Built with performance in mind
  • Simple usage
  • Rich collection of validation patterns
  • No third party libraries was used

  • Step-by-step validation

  • Form resetting
  • Watching form values
  • Environment mode
  • Usage with reusable Input components

Simple Usage

import { useKBform } from "react-kb-form";

const {
  _register,
  _handleSubmit,
  _envMode,
  _reset,
  watchState,
  formState,
  errorState,
  formStatus,
} = useKBform();

<form ref={_register} _formname="form" onSubmit={_handleSubmit}>
  <input
    name="example"
    _required="this field is required"
    _email="provided value is not valid email"
  />
  {errorState.example}

  <button type="submit">submit</button>
</form>;

useEffect(() => {
  if (formState) {
    console.log(formState.form);
  }
}, [formState]);

Available Props

_required: string;
_number: string;
_min: string;
_max: string;
_password: string;
_passwordrepeat: string;
_strongpassword: string;
_minlength: string;
_maxlength: string;
_length: string;
_email: string;
_amount: string;
_pan: string;
_panbasic: string;
_pin: string;
_formname: string;
_customregex: string;
_resetbtn: string;
_ignore: string;
_phone: string;

Contributors

Github account - Sabuhi Nazarov

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Detailed docs coming soon ...

1.1.0

5 years ago

1.0.59

5 years ago

1.0.55

5 years ago

1.0.58

5 years ago

1.0.56

5 years ago

1.0.54

5 years ago

1.0.53

5 years ago

1.0.52

5 years ago

1.0.51

5 years ago

1.0.49

5 years ago

1.0.50

5 years ago

1.0.46

5 years ago

1.0.45

5 years ago

1.0.44

5 years ago

1.0.43

5 years ago

1.0.42

5 years ago

1.0.41

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.40

5 years ago

1.0.37

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.29

5 years ago

1.0.30

5 years ago

1.0.28

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.27

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago