# formance

> Reusable form library for React

Latest version **0.0.16-alpha** (published 2019-06-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install formance
pnpm add formance
yarn add formance
bun add formance
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.16-alpha |
| Published | 2019-06-14 |
| First published | 2019-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 108.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | vobi.io |
| Maintainers | vobi |
| Keywords | react, form |

## Links

- npm: https://www.npmjs.com/package/formance
- Repository: https://github.com/vobi-io/formance
- Homepage: https://github.com/vobi-io/formance#readme
- Issues: https://github.com/vobi-io/formance/issues
- npm.io page: https://npm.io/package/formance

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.11

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.16-alpha (latest) — 2019-06-14
- 0.0.15-alpha — 2019-06-04
- 0.0.14-alpha — 2019-06-04
- 0.0.13-alpha — 2019-06-01
- 0.0.12-alpha — 2019-06-01
- 0.0.11-alpha — 2019-06-01
- 0.0.10-alpha — 2019-05-13
- 0.0.9-alpha — 2019-05-13
- 0.0.8-alpha — 2019-05-10
- 0.0.7-alpha — 2019-05-10
- 0.0.6-alpha — 2019-05-09
- 0.0.5-alpha — 2019-05-08
- 0.0.4-alpha — 2019-05-06
- 0.0.3-alpha — 2019-05-06
- 0.0.2-alpha — 2019-05-06
- … 1 more at https://npm.io/package/formance/versions

## README

# Formance

Enjoy forms in React :smirk:

## Installation

```
npm install --save formance
```

or

```
yarn add formance
```

## Getting Started

Formance helps to simplify managing forms in React. It's main goals are productivity and extensibility. To accomplish these goals it sets some convenient defaults and handles some repetitive jobs automatically and, also, provides clean api for constructing custom solutions.

## Basic Example

Let's take a quick look:

```jsx
import { Form, Field, FieldError } from 'formance'
import { isEmail } from './some-validators'

const isRequired = value =>
  (value ? undefined : 'Required')

const submitHandler = values => {
  console.log('values:', values)
}

const MyComponent = () => (
  <Form submitHandler={submitHandler}>
    {({ valid, onSubmit, submitting, submitted }) => (
      <form onSubmit={onSubmit}>
        <Field
          name="name"
          placeholder="Name"
          validate={isRequired}
          displayError
        />
        <FieldError name="name" />

        <Field
          name="email"
          placeholder="Email"
          validate={[isRequired, isEmail]} // validators will run in giving order, first error will be returned
          displayError // shortcut for <FieldError name="email" />
        />

        <button disabled={(submitted && !valid) || submitting}>
          {submitting ? 'Saving...' : 'Save'}
        </button>
      </form>
    )}
  </Form>
)

export default MyComponent

```

More docs and examples coming soon...

---
_Source: https://npm.io/package/formance · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
