All Projects → react-html-form → react-html-form

react-html-form / react-html-form

Licence: MIT license
Friendly form library for React ✌️

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Labels

Projects that are alternatives of or similar to react-html-form

contact-officials
Form definitions powering Resistbot's electronic deliveries to elected officials in the United States.
Stars: ✭ 29 (-50%)
Mutual labels:  form
enketo-core
The engine that powers Enketo Tools - Use it to develop your own enketo-powered app.
Stars: ✭ 74 (+27.59%)
Mutual labels:  form
GenerateDynamicCustomForm
You can generate a dynamic form view in a few minutes for a signup, add a record. Creating a form is very easy.
Stars: ✭ 18 (-68.97%)
Mutual labels:  form
Forms
Tracking our progress moving all city paper and pdf forms online.
Stars: ✭ 14 (-75.86%)
Mutual labels:  form
react-file-input-previews-base64
This package provides an easy to use, ready to go and customizable wrapper around file input, with option for image previews and returning file as base64 string.
Stars: ✭ 15 (-74.14%)
Mutual labels:  form
designable
🧩 Make everything designable 🧩
Stars: ✭ 2,156 (+3617.24%)
Mutual labels:  form
react-drip-form
☕ HoC based React forms state manager, Support for validation and normalization.
Stars: ✭ 66 (+13.79%)
Mutual labels:  form
stook
A minimalist design state management library for React.
Stars: ✭ 86 (+48.28%)
Mutual labels:  form
form
Flow Form Framework
Stars: ✭ 14 (-75.86%)
Mutual labels:  form
json-schema-js-gui-model
Handy gui model and associated translator that can be used to construct javascript UI forms from json-schemas
Stars: ✭ 19 (-67.24%)
Mutual labels:  form
formily
Simple, lightweight, and flexible schema-based form for Vue.js
Stars: ✭ 23 (-60.34%)
Mutual labels:  form
react-native-radio-buttons-group
Simple, best and easy to use radio buttons for react native apps.
Stars: ✭ 145 (+150%)
Mutual labels:  form
autoform
🤖📝 AutoForm is the simplest way to automatically generate fast, beautiful and standards/WCAG compliant HTML forms based on an Ecto Schema in a Phoenix Web Application to *significantly* speed up Web App Development. 🚀
Stars: ✭ 18 (-68.97%)
Mutual labels:  form
lomake
HTML Form generator from Go structs
Stars: ✭ 12 (-79.31%)
Mutual labels:  form
TextFieldsTraversalController
A controller to manage the traversal of a collection of textfields.
Stars: ✭ 15 (-74.14%)
Mutual labels:  form
SwiftyExcelView
A View Look Like Excel & Form
Stars: ✭ 45 (-22.41%)
Mutual labels:  form
react-cool-form
😎 📋 React hooks for forms state and validation, less code more performant.
Stars: ✭ 246 (+324.14%)
Mutual labels:  form
bulma-material-form
Material Design Form Elements for Bulma (CSS Only)
Stars: ✭ 26 (-55.17%)
Mutual labels:  form
dynamic-input-fields-reactjs
Example of the dynamic input fields in ReactJS
Stars: ✭ 31 (-46.55%)
Mutual labels:  form
vue-elementui-freedomen
elementui 应用级框架
Stars: ✭ 27 (-53.45%)
Mutual labels:  form

react-html-form

The simplest form component for React

Notice: This project is in beta. I'm seeking beta testers and co-authors/maintainers.

Immediate roadmap: feedback/bug reports from the community, documentation, unit tests.

Overview

"HTML form elements work a little bit differently from other DOM elements in React, because form elements naturally keep some internal state."[1] What this means, unfortunately, is that managing form state in React is not an easy feat.

Our mission is to build a great developer experience around forms. We let you manage forms with a straightforward API by embracing the fact that forms keep internal state, not fighting against it.

Problems with current form libraries

Other React form libraries introduce patterns that aren’t very ergonomic or have a large API surface. They often require the user to build their own input primitives that are tightly coupled to the library. Even more, they usually require the user to bring their own validation, something the browser actually offers for free!

How react-html-form is different

We keep our API surface small by pulling form state (values and errors) directly out of the DOM through the HTMLFormElement interface and Constraint Validation API.

Install

$ npm install react-html-form@beta --save
$ # or
$ yarn add react-html-form@beta

Usage

See https://codesandbox.io/embed/x70lxkzkvo?hidenavigation=1&view=split for a full "KitchenSink" demo.

import Form from "react-html-form";
import React from "react";

class MyPage extends React.Component {
  handleSubmit(event, formState, formReference) {
    // formState = {
    //   values: {
    //     usersName: 'demo',
    //     usersEmail: '[email protected]',
    //   },
    //   errors: {},
    //   dirty: {
    //     usersName: true,
    //     usersEmail: true,
    //   },
    //   touched: {
    //     usersName: true,
    //     usersEmail: true,
    //   },
    //   blurred: {
    //     usersName: true,
    //     usersEmail: true,
    //   },
    //   isDirty: true,
    //   isValid: true,
    //   isValidating: false,
    //   submitCount: 1
    // }
    yourHttpClient.post("http://api.example.com/", formState.values);
  }

  render() {
    return (
      <React.Fragment>
        <Form
          // include `WithData` to any form event handler to get the
          // form state included for free as the second argument.
          // The third argument is a reference to the form itself
          // You can still use the standard `onSubmit` if you please
          onSubmitWithData={this.handleSubmit}
        >
          <label>Name:</label>
          <input
            required
            data-errormessage="Name can only include letters"
            pattern="A-Za-z+"
            name="usersName"
            type="text"
          />
          <br />
          <label>Email</label>
          <input required name="email" type="email" />
          <br />
          <button type="submit">Submit</button>
        </Form>
      </React.Fragment>
    );
  }
}

Credits

  • Logomark via align by Chameleon Design from the Noun Project

Footnotes:

1: https://reactjs.org/docs/forms.html

License

MIT

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].