All Projects → iusehooks → Usetheform

iusehooks / Usetheform

Licence: mit
React library for composing declarative forms, manage their state, handling their validation and much more.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Usetheform

React Hook Form
📋 React Hooks for form state management and validation (Web + React Native)
Stars: ✭ 24,831 (+61977.5%)
Mutual labels:  hooks, validation, form-validation, form, forms, form-builder
react-cool-form
😎 📋 React hooks for forms state and validation, less code more performant.
Stars: ✭ 246 (+515%)
Mutual labels:  hooks, forms, form, form-validation, form-builder
Redux Form
A Higher Order Component using react-redux to keep form state in a Redux store
Stars: ✭ 12,597 (+31392.5%)
Mutual labels:  validation, form-validation, form, forms
Form For
ReactJS forms made easy
Stars: ✭ 118 (+195%)
Mutual labels:  form-validation, form, forms, form-builder
Formium
The headless form builder for the modern web.
Stars: ✭ 78 (+95%)
Mutual labels:  hooks, form, forms, form-builder
grav-plugin-form
Grav Form Plugin
Stars: ✭ 48 (+20%)
Mutual labels:  forms, form, form-validation, form-builder
Resolvers
📋 Validation resolvers: Zod, Yup, Joi, Superstruct, and Vest.
Stars: ✭ 222 (+455%)
Mutual labels:  hooks, validation, form-validation, form
React Final Form
🏁 High performance subscription-based form state management for React
Stars: ✭ 6,781 (+16852.5%)
Mutual labels:  validation, form-validation, form, forms
Formik
Build forms in React, without the tears 😭
Stars: ✭ 29,047 (+72517.5%)
Mutual labels:  hooks, form, forms
form-data-json
A zero dependency, cross browser library to easily get or set/manipulate form input values as/from a json object.
Stars: ✭ 37 (-7.5%)
Mutual labels:  forms, form, form-validation
Formsy React
A form input builder and validator for React JS
Stars: ✭ 708 (+1670%)
Mutual labels:  validation, form-validation, form
react-useForm
World's simplest React hook to manage form state
Stars: ✭ 30 (-25%)
Mutual labels:  hooks, form, form-validation
antd-react-form-builder
Example
Stars: ✭ 74 (+85%)
Mutual labels:  form, form-validation, form-builder
formio
Formio, form definition and binding library for Java platform
Stars: ✭ 24 (-40%)
Mutual labels:  forms, form-validation, form-builder
ember-validity-modifier
Ember Octane addon to add custom validity (form validation) to form fields
Stars: ✭ 28 (-30%)
Mutual labels:  forms, form, form-validation
formalizer
React hooks based form validation made for humans.
Stars: ✭ 12 (-70%)
Mutual labels:  validation, form, form-validation
FrontendForms
A module for ProcessWire CMS to create and validate forms on the frontend easily using the Valitron library.
Stars: ✭ 0 (-100%)
Mutual labels:  forms, form, form-validation
vue-use-form
✅ A Vue.js composition API function to validate forms
Stars: ✭ 97 (+142.5%)
Mutual labels:  forms, form, form-validation
Ok
✔️ A tiny TypeScript library for form validation
Stars: ✭ 34 (-15%)
Mutual labels:  validation, form-validation, form
React Form
⚛️ Hooks for managing form state and validation in React
Stars: ✭ 2,270 (+5575%)
Mutual labels:  hooks, form, forms

Usetheform Logo

An easy way for building forms in React.


Code Coverage Build info Bundle size Tweet




💡 What is usetheform about?

Welcome! 👋 Usetheform is a React library for composing declarative forms and managing their state. It does not depend on any external library like Redux, MobX or others, which makes it to be easily adoptedable without other dependencies.

🔥 Features

⚡️ Quickstart

npm install --save usetheform
import React from "react";
import { Form, Input, useValidation } from "usetheform";

const preventNegativeNumber = (next, prev) => (next <= 0 ? 0 : next);
const required = (value) =>
    value && value.trim() !== "" ? undefined : "Required";

export default function App() {
  const onChange = (formState) => console.log("ON_CHANGE : ", formState);
  const onSubmit = (formState) => console.log("ON_SUBMIT : ", formState);

  const [status, validation] = useValidation([required]);

  return (
    <Form onSubmit={onSubmit} onChange={onChange}>
      <Input name="firstname" type="text" touched {...validation} />
      {status.error && <span>{status.error}</span>}
      <Input name="lastname" type="text" />
      <Input name="age" type="number" value={18} reducers={preventNegativeNumber} />
      <button type="submit">Submit</button>
    </Form>
  );
}

Motivation

usetheform has been built having in mind the necessity of developing a lightweight library able to provide an easy API to build complex forms composed by nested levels (arrays, objects, custom inputs, etc.) with a declarative approach and without the need to include external libraries within your react projects.

It's easy to start using it in your existing project and gives you a full controll over Field, Collection at any level of nesting which makes easy to manipulate the form state based on your needs. Synchronous and asynchronous validations are simple and error messages easy to customize and display. If you find it useful please leave a star 🙏🏻.

Author

↳ Stargazers

Stargazers repo roster for @iusehooks/usetheform

Code Sandboxes

  • Twitter What's Happening Form Bar: Sandbox
  • Shopping Cart: Sandbox
  • Examples: Slider, Select, Collections etc..: Sandbox
  • Validation using Yup, ZOD, JOI, Superstruct: Sandbox
  • Wizard: Sandbox
  • FormContext: Sandbox
  • Material UI - React Select: Sandbox
  • React Dropzone - Material UI Dropzone: Sandbox
  • Various Implementation: Sandbox

Contributing

🎉 First off, thanks for taking the time to contribute! 🎉

We would like to encourage everyone to help and support this library by contributing. See the CONTRIBUTING file.

License

This software is free to use under the MIT license. See the LICENSE file for license text and copyright information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].