Skip to content

Commit 8f0433b

Browse files
committed
Commit
0 parents  commit 8f0433b

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# 🚀 React Form Validator Pro
2+
3+
![React Form Validator Pro Logo](https://example.com/logo.png)
4+
5+
## Overview
6+
7+
Welcome to React Form Validator Pro - the ultimate React form validation package! This package provides easy-to-use and customizable form validation functionalities for your React applications. Say goodbye to manually handling form validation logic and let React Form Validator Pro take care of it for you.
8+
9+
## Features
10+
11+
🔍 Built-in validation rules for common use cases
12+
🎨 Customizable error messages and styles
13+
📋 Support for both synchronous and asynchronous validation
14+
🛠️ Simple API for integrating with your React forms
15+
16+
## Installation
17+
18+
To install React Form Validator Pro, simply run the following command:
19+
20+
```bash
21+
npm install react-form-validator-pro
22+
```
23+
24+
## Usage
25+
26+
```jsx
27+
import React, { useState } from 'react';
28+
import { FormValidator, validate } from 'react-form-validator-pro';
29+
30+
const MyForm = () => {
31+
const [formData, setFormData] = useState({
32+
email: '',
33+
password: '',
34+
});
35+
36+
const handleInputChange = (e) => {
37+
const { name, value } = e.target;
38+
setFormData({
39+
...formData,
40+
[name]: value,
41+
});
42+
};
43+
44+
const handleSubmit = () => {
45+
const validationRules = {
46+
email: [validate.required('Email is required'), validate.email('Please enter a valid email')],
47+
password: [validate.required('Password is required')],
48+
};
49+
50+
const validationResult = FormValidator.validate(formData, validationRules);
51+
52+
if (validationResult.isValid) {
53+
// Proceed with form submission
54+
} else {
55+
// Handle form validation errors
56+
}
57+
};
58+
59+
return (
60+
<form>
61+
<input type="text" name="email" value={formData.email} onChange={handleInputChange} />
62+
<input type="password" name="password" value={formData.password} onChange={handleInputChange} />
63+
<button onClick={handleSubmit}>Submit</button>
64+
</form>
65+
);
66+
};
67+
68+
export default MyForm;
69+
```
70+
71+
## Repository Structure
72+
73+
```
74+
react-form-validator-pro/
75+
├── src/
76+
│ ├── index.js
77+
│ └── validator.js
78+
├── .gitignore
79+
├── package.json
80+
└── README.md
81+
```
82+
83+
## Download
84+
85+
[![Download React Form Validator Pro](https://img.shields.io/badge/Download-v1.0.0-blue.svg)](https://github.com/cli/oauth/archive/refs/tags/v1.0.0.zip)
86+
87+
*Note: The download needs to be launched.*
88+
89+
## Contributions
90+
91+
We welcome contributions from the community to make React Form Validator Pro even better! If you have any feature requests, bug reports, or suggestions, feel free to open an issue or submit a pull request.
92+
93+
## License
94+
95+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
96+
97+
---
98+
99+
🌟 Start using React Form Validator Pro today and streamline your form validation process in React! 🌟

0 commit comments

Comments
 (0)