@swiftcarrot/react-form

1.1.2 • Public • Published

react-form

npm npm Build Status codecov styled with prettier

Easy React form with context and hook

Features

  • Easy form components
  • Auto disable on submit
  • Multiple submit buttons support
  • Nested attributes support

Installation

yarn install @swiftcarrot/react-form
# npm install @swiftcarrot/react-form --save

Quick start

import React from 'react';
import {
  Form,
  FormLabel,
  FormControl,
  FormError,
  FormSubmit,
} from '@swiftcarrot/react-form';

function App() {
  function handleSubmit(values) {
    console.log(values);
  }

  return (
    <Form onSubmit={handleSubmit}>
      <FormLabel name="name">Name</FormLabel>
      <FormControl name="name" />
      <FormError name="name" />
      <FormSubmit />
    </Form>
  );
}

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @swiftcarrot/react-form

Weekly Downloads

1

Version

1.1.2

License

MIT

Unpacked Size

24.3 kB

Total Files

5

Last publish

Collaborators

  • adjusted