Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

formsy-react

> 编程语言
Open source

A form input builder and validator for React JS

2.6K stars0 likes0 views
WebsiteGitHub

About

A form input builder and validator for React JS

Moved!

This project has moved. Starting from 1.0.0 onward, develeopment will continue at https://github.com/formsy/formsy-react/


formsy-react

A form input builder and validator for React JS

How to use API Examples

Background

I wrote an article on forms and validation with React JS, Nailing that validation with React JS, the result of that was this extension.

The main concept is that forms, inputs and validation is done very differently across developers and projects. This extension to React JS aims to be that "sweet spot" between flexibility and reusability.

What you can do

  1. Build any kind of form element components. Not just traditional inputs, but anything you want and get that validation for free

  2. Add validation rules and use them with simple syntax

  3. Use handlers for different states of your form. Ex. "onSubmit", "onError", "onValid" etc.

  4. Pass external errors to the form to invalidate elements

  5. You can dynamically add form elements to your form and they will register/unregister to the form

Default elements

You can look at examples in this repo or use the formsy-react-components project to use bootstrap with formsy-react, or use formsy-material-ui to use Material-UI with formsy-react.

Install

  1. Download from this REPO and use globally (Formsy) or with requirejs
  2. Install with npm install formsy-react and use with browserify etc.
  3. Install with bower install formsy-react

Changes

Check out releases

Older changes

How to use

See examples folder for examples. Codepen demo.

Complete API reference is available here.

Formsy gives you a form straight out of the box

…

This code results in a form with a submit button that will run the submit method when the submit button is clicked with a valid email. The submit button is disabled as long as the input is empty (required) or the value is not an email (isEmail). On validation error it will show the message: "This is not a valid email".

Building a form element (required)

…

The form element component is what gives the form validation functionality to whatever you want to put inside this wrapper. You do not have to use traditional inputs, it can be anything you want and the value of the form element can also be anything you want. As you can see it is very flexible, you just have a small API to help you identify the state of the component and set its value.

Related projects

  • formsy-material-ui - A formsy-react compatibility wrapper for Material-UI form components.
  • formsy-react-components - A set of React JS components for use in a formsy-react form.
  • ...
  • Send PR for adding your project to this list!

Contribute

  • Fork repo
  • npm install
  • npm run examples runs the development server on localhost:8080
  • npm test runs the tests

License

The MIT License (MIT)

Copyright (c) 2014-2016 PatientSky A/S

GitHub Issues· 0 open

View all on GitHub

No open issues yet, or sync has not completed.

Highlights

  • •formsy-material-ui - A formsy-react compatibility wrapper for Material-UI form components.
  • •formsy-react-components - A set of React JS components for use in a formsy-react form.
  • •Send PR for adding your project to this list!
  • •Fork repo
  • •npm install
  • •npm run examples runs the development server on localhost:8080
  • •npm test runs the tests

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言