1.0.0 • Published 8 years ago

react-jsonschema v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

React JSONSchema

Build Status Coverage Status license

Create beautiful forms with JSONSchema Inspired by react-jsonschema-form from Mozilla.

npm.io

Installation

$ npm install --save react-jsonschema

Usage

import Form from 'react-jsonschema';

const schema = {
  "title": "Basic Demo",
  "type": "object",
  "properties": {
    "firstName": {
      "type": "string",
      "title": "First Name",
    },
    "lastName": {
      "type": "string",
      "title": "Last Name",
    },
    "age": {
      "type": "integer",
      "title": "Age",
      "description": "Age in years",
    },
  },
};

const formData = {
  firstName: '',
  lastName: '',
  age: '',
};

ReactDOM.render(
  <Form
    schema={schema}
    formData={formData}
    onError={errors => {
      console.log(errors);
    }}
    onSubmit={data => {
      console.log(data);
    }}
  />,
  document.getElementById('app'),
);

Contributing

  1. Clone the repository
  2. Install dependencies

    With npm:

    $ npm install

    With yarn:

    $ yarn
  3. Run tests: npm t

References

License

MIT © Vu Tran

1.0.0

8 years ago

0.5.0

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.0

8 years ago