frig-js / frig

Simple but powerful forms for React. Inspired by SimpleForm. https://frig-js.github.io/frig
MIT License
10 stars 2 forks source link

Frig

Circle CI Coverage Status NPM

React Forms made easy / Developed at TouchBistro in Toronto.

Frig is:

Installation

Note: For non ES6 browser compatibility you will also need to install the Babel PolyFill.

Hello Frigging World

// One time theme selection
// (put this in an initialization file and call it once)
import Frig from "frig"
import FriggingBootstrap from "frigging-bootstrap"
Frig.defaultTheme(FriggingBootstrap)

// ...

// Libraries needed for each component
import React from "react"
import ReactDOM from "react-dom"
import {Form, Input, Submit} from "frig"

class TheBasicsExample extends React.Component {
  displayName = "TheBasicsExample"
  state = {account: {}}

  render() {
    return (
      <Form
        data={this.state.account}
        onChange={(account) => this.setState({account})}
      >
        <div className="row">
          <Input name="email"/>
          <Input name="password"/>
          <Input name="rememberMe" type="switch"/>
          <Submit title="Sign In"/>
        </div>
      </Form>
    )
  }
}

Themes

Much of Frig's functionality is provided by Frig themes.

Currently, the default theme (and only) is Frigging Bootstrap.

Documentation

More information is available in the documentation:

http://frig-js.github.io/frig/

Examples

https://github.com/frig-js/frigging-examples

License

Frig is licensed under the MIT license.