# react-ez-useform

> Easy React Form Component

Latest version **1.4.7** (published 2021-10-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-ez-useform
pnpm add react-ez-useform
yarn add react-ez-useform
bun add react-ez-useform
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.7 |
| Published | 2021-10-30 |
| First published | 2021-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 46 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Janith Yapa |
| Maintainers | janithyapa |
| Keywords | react, form |

## Links

- npm: https://www.npmjs.com/package/react-ez-useform
- Repository: https://github.com/janithcyapa/react-form
- Homepage: https://github.com/janithcyapa/react-form#readme
- Issues: https://github.com/janithcyapa/react-form
- npm.io page: https://npm.io/package/react-ez-useform

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.4.7 (latest) — 2021-10-30
- 1.4.6 — 2021-10-30
- 1.4.5 — 2021-10-27
- 1.4.4 — 2021-10-27
- 1.4.3 — 2021-10-27
- 1.4.2 — 2021-10-27
- 1.4.1 — 2021-10-27
- 1.4.0 — 2021-10-27
- 1.3.2 — 2021-10-27
- 1.3.1 — 2021-10-27
- 1.3.0 — 2021-10-27
- 1.2.3 — 2021-10-27
- 1.2.2 — 2021-10-27
- 1.2.1 — 2021-10-27
- 1.2.0 — 2021-10-27
- … 10 more at https://npm.io/package/react-ez-useform/versions

## README

<h1 align="center">React UseHook</h1>
<div align="center">

Quickly build [React](https://reactjs.org/) forms. React UseHook is a simple and customizable form component and hook.

</div>

<div align="center">

[![npm downloads](https://img.shields.io/npm/dm/react-ez-useform.svg)](https://www.npmjs.com/package/react-ez-useform)
[![npm](https://img.shields.io/npm/dt/react-ez-useform.svg)](https://www.npmjs.com/package/react-ez-useform)
[![npm](https://img.shields.io/npm/l/react-ez-useform.svg?color=red)](https://github.com/react-ez-useform/react-ez-useform/blob/master/LICENSE)
[![version](https://img.shields.io/npm/v/react-ez-useform.svg)](https://www.npmjs.com/package/react-ez-useform)

</div>

## Features

- Simple, Easy to use
- Minimum code base
- Built-in un-styled component library
- Form Validation with Joi

## Installation

React UseHook is available as an [npm package](https://www.npmjs.com/package/react-ez-useform).

```sh
// with npm
npm install react-ez-useform

// with yarn
yarn add react-ez-useform
```

## Quickstart

```jsx
import React from "react";
import { useForm } from "react-ez-useform";

function App() {
  const onSubmitFunc = async (data) => {};
  const { inputProps, onSubmit, loading } = useForm(onSubmitFunc);

  return (
    <form onSubmit={onSubmit} className="">
        <Form.Input {...inputProps("Title", Joi.string().required()), 'Initial Title'} />
        <Form.Submit loading={loading} label="Save" />
      </form>
  );
}
```

## Styling

```css
.form-input {
  @apply px-4 py-1.5 rounded cursor-pointer w-full;
  @apply text-gray-700 bg-gray-100;
  @apply border-2  focus:border-gray-500 hover:border-gray-300;
}
.form-text-area {
  @apply px-4 py-1.5 rounded cursor-pointer w-full;
  @apply text-gray-700 bg-gray-100;
  @apply border-2  focus:border-gray-500 hover:border-gray-300;
}
.form-select {
  @apply px-4 py-1.5 rounded cursor-pointer w-full;
  @apply text-gray-700 bg-gray-100;
  @apply border-2  focus:border-gray-500 hover:border-gray-300;
}
.form-file {
  @apply overflow-hidden w-36 h-36 bg-gray-200 rounded-xl;
}
.form-img {
  @apply overflow-hidden w-full h-96 bg-gray-200 rounded-xl;
}
.form-label {
  @apply text-gray-400 m-2;
}
.form-error {
  @apply mx-4 text-sm text-red-400 italic mt-0.5;
}
.form-hint {
  @apply mx-4 text-sm text-gray-400 italic mt-0.5;
}
.form-submit {
  @apply bg-primary text-white font-semibold rounded-lg px-6 py-2.5;
  @apply transition duration-300 ease-in-out transform hover:scale-105 hover:shadow-md;
}
.form-reset {
  @apply text-sm text-primary font-light px-6 py-1;
  @apply transition duration-300 ease-in-out transform hover:scale-105 hover:underline;
}
```

---
_Source: https://npm.io/package/react-ez-useform · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
