New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-jsonschema-form

Package Overview
Dependencies
Maintainers
4
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-jsonschema-form

A simple React component capable of building forms from a JSON schema.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
47K
increased by3.46%
Maintainers
4
Weekly downloads
 
Created
Source

react-jsonschema-form

Build Status

A simple React component capable of building forms from a JSON schema.

Requires React 0.14+.

Installation

As a npm-based project dependency:

$ npm install react-jsonschema-form --save

As a script dependency served from a CDN:

  <script src="https://npmcdn.com/react-jsonschema-form@0.1.0/dist/react-jsonschema-form-0.1.0.js"></script>

Source maps are available at this url.

Note that the CDN version does not embed react nor react-dom.

Usage

import React, { Component } from "react";
import { render } from "react-dom";

import Form from "react-jsonschema-form";

const schema = {
  title: "Todo Tasks",
  type: "object",
  required: ["title"],
  properties: {
    title: {type: "string", title: "Title", default: "A new task"},
    done: {type: "boolean", title: "Done?", default: false}
  }
};

const formData =  {
  title: "First task",
  done: true
};

const log = (type) => console.log.bind(console, type);

render((
  <Form schema={schema}
        formData={formData}
        onChange={log("changed")}
        onSubmit={log("submitted")}
        onError={log("errors")} />
), document.getElementById("app"));

Development server

$ npm start

A Cosmos development server showcasing components with hot reload enabled is available at localhost:8080.

Tests

$ npm test

TDD

$ npm run tdd

License

Apache 2

Keywords

FAQs

Package last updated on 18 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc