Skip to content

moser-inc/react-json-form

Repository files navigation

react-json-form Build Status

react-json-form is an attempt at simplifying the creation of forms that output nested JSON objects.

Installation

Yarn

$ yarn add react-json-form

NPM

$ npm install --save react-json-form

Usage

import React from 'react'
import { render } from 'react-dom'
import { BasicForm as Form, createInput } from 'react-json-form'

const Input = createInput(props => <input {...props} />)

render(
  <Form onSubmit={json => console.log(json)}>
    Name: <Input type="text" path="name" /><br />
    Age: <Input type="number" path="age" /><br />
    <button type="submit">Show me the JSON</button>
  </Form>,
  document.getElementById('root')
)

About

React Form HOC which produces JSON output

Resources

License

Stars

Watchers

Forks

Packages

No packages published