1.10.16 • Published 4 months ago

ease-validator v1.10.16

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

šŸš€ EaseValidator - The Ultimate React Form Validation Library

šŸ“Œ Simplify form validation in React with ease!


šŸ“– About EaseValidator

EaseValidator ek lightweight, developer-friendly aur powerful React form validation library hai jo real-time validation, custom error messages, file uploads, aur advanced form handling ko easy banata hai.

šŸ’” Kya aapko React mein form validation karna boring lagta hai?
⚔ EaseValidator ka use karo aur form validation ko smooth banao!


šŸ”„ Features

āœ”ļø Instant Validation – As you type validation support.
āœ”ļø File Upload Validation – File type & size constraints.
āœ”ļø Custom Error Messages – Personalized error messages.
āœ”ļø Fully Customizable – Apne project ke hisaab se validation rules set karo.
āœ”ļø Lightweight & Fast – No unnecessary dependencies. āœ”ļø Optimized for Performance – Minimum re-renders, maximum efficiency.


šŸ“¦ Installation

npm install ease-validator


USAGE EXAMPLE REACTJS:
  
  import { useSmartForm } from "ease-validator";

const MyForm = () => {
  const { register, handleSubmit, errors } = useSmartForm({
    validationSchema: {
      name: { required: true, minLength: 3 },
      email: { required: true, email: true },
      password: { required: true, minLength: 6 },
      file: { required: true, fileType: ["image/png", "image/jpeg"], maxSize: 2 },
    },
  });

  const onSubmit = (data) => {
    console.log("Form Data:", data);
  };

  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <input type="text" placeholder="Name" {...register("name")} />
      {errors.name && <p>{errors.name}</p>}

      <input type="email" placeholder="Email" {...register("email")} />
      {errors.email && <p>{errors.email}</p>}

      <input type="password" placeholder="Password" {...register("password")} />
      {errors.password && <p>{errors.password}</p>}

      <input type="file" {...register("file")} />
      {errors.file && <p>{errors.file}</p>}

      <button type="submit">Submit</button>
    </form>
  );
};

export default MyForm;
1.10.16

4 months ago

1.10.15

4 months ago

1.10.14

4 months ago

1.10.13

4 months ago

1.10.12

4 months ago