0.0.14 • Published 7 years ago

react-schemaform v0.0.14

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

React schema form

Light weight react components for rendering forms based on JSON Schema

Using dependency injection to support multiple rendering themes/libraries. Easily extendable by replacing some or all rendering components. Inspired by libraries like json-schema-form.

Getting started

Install

npm install react-schemaform --save

Usage

import SchemaForm from 'react-schemaform';

const schema = {
    title: 'Test schema',
    type: 'object',
    properties: {
        name: { type: 'string' },
        age: { type: 'integer' }
    }
};

const value = {
    name: 'John Doe',
    age: 42
};

<SchemaForm
    schema={ schema }
    value={ value }
    onChange={ value => console.info('Form change', value) }
/>

Status

Work in progress

TODO

  • Inline validation
  • Unsupported validation keywords (list below)

JSON Schema feature support

Schema keywords supported

  • title
  • description
  • type
    • string
    • number
    • integer
    • boolean
    • null
    • array
    • object
  • maxLength (counter)
  • items (schema object)
  • items (array of schemas)
  • properties
  • additionalProperties
  • const

  • format

    • date-time
    • email
    • hostname
    • ipv4
    • ipv6
    • uri
    • uri-reference
    • uri-template
    • json-pointer
  • readOnly
  • multipleOf
  • maximum
  • exclusiveMaximum
  • minimum
  • exclusiveMinimum
  • maxLength
  • minLength
  • pattern
  • additionalItems
  • maxItems
  • minItems
  • uniqueItems
  • contains
  • maxProperties
  • minProperties
  • required
  • patternProperties
  • dependencies
  • propertyNames
  • enum
  • allOf
  • anyOf
  • oneOf
  • not

Rendering frameworks

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.2

7 years ago