storm-react-forms
TypeScript icon, indicating that this package has built-in type declarations

2.1.3 • Public • Published

STORM React Forms

DEMO: http://projectstorm.cloud/react-forms

A super simple, no-nonsense form library written in React that (hopefully) just works.

Join the chat at https://gitter.im/projectstorm/react-forms NPM NPM CircleCI

Demo1

Start Here

Forms in React can be quite difficult, but with this library, forms become quite easy. Storm React Forms (SRF) provides a simple way to create forms in a very declarative way.

Declare your form using standard react widgets, but make use of Storm Element Widgets when you want to actually use an input field. When you click submit on your form, the form will fire a formSubmitEvent(model) which will contain an object with all the values in your form.

Example

<FormWidget formSubmitEvent={ model => console.log(model) }>
	<TableLayoutWidget>
		<FieldElementWidget name="Name" />
		<FieldElementWidget name="Surname" />
	</TableLayoutWidget>
</FormWidget>

The model will contain {Name, Surname}

One-way binding

you can pass a value={object} onto a form and it will automatically populate your form fields with the values in the object. This does not change object when the form fires but instead will pass the new object as the first param in the formSubmitEvent(object) (like in the previous example)

Usage

Take a look at the demos URL as well as the demos folder (docs will follow soon)

Package Sidebar

Install

npm i storm-react-forms

Weekly Downloads

3

Version

2.1.3

License

none

Unpacked Size

78.8 kB

Total Files

29

Last publish

Collaborators

  • dylanvorster