8000 GitHub - ngduc/ez-react-form at 0.6.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ngduc/ez-react-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ez-react-form

Build Status

A simple way to work with Forms in React.

🌟 Features

$ npm install ez-react-form
import { FormContainer, Form, Field, Button } from 'ez-react-form';

<FormContainer onSubmit={this.onSubmit} render={props => (
  <Form use="bootstrap4">
    <Field>Text Field | text</Field>
    <Field password>Password | password</Field>
    <Field textarea>Textarea | textarea</Field>
    <Field select options={animals}>Select | select</Field>
    <Field radios options={genders}>Radios | radio</Field>
    <Field checkboxes options={roles}>Checkboxes | checkboxes</Field>
    <Field number>Number | number</Field>
    <Field date>Date | date</Field>
    <Field time>Time | time</Field>
    <Field toggle inline>Toggle | toggle</Field>
    <Field file>File Upload | file1</Field>
    <Field file withPreview>File Upload (with Preview) | file2</Field>
    <Field range>Range | range</Field>

    <Button type="submit"/>
    <Button>Cancel</Button>
  </Form>
)} 
70C4
/>

Result: (Full form, validation (with yup) & error messages)

Screenshot

  • Shorthand syntax <Field>Label | Placeholder | name</Field> (yes, child is a string for convenience, props work too if you prefer that). Inspired by Styled Component literal string for CSS.
  • Render different form layouts: Bootstrap4, Spectre and more.
  • Compatible with formik. This is built on top of formik and can be used together with it (for custom fields, etc.)

📖 Documentation

Change Log

TODO:

  • Support: Material, Semantic UI and more.
  • More field types: Date Range, etc.
  • (File a PR to request any feature, field type, etc.)

🙌 Thanks

All contributions are welcome!

formik

About

A simple way to work with Forms in React.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0