0.9.1 • Published 3 years ago

liform-react v0.9.1

Weekly downloads
405
License
MIT
Repository
github
Last release
3 years ago

liform-react

tests

Library for generating React forms from JSON schema using the fantastic redux-form.

https://limenius.github.io/liform-react/

Installation

npm install liform-react --save

Basic usage

import React from 'react';
import ReactDOM from 'react-dom';

import { createStore, combineReducers } from 'redux';
import { reducer as formReducer } from 'redux-form';
import { Provider } from 'react-redux';
import Liform from 'liform-react';


const reducer = combineReducers({
  form: formReducer
})

var schema = {
    "title":"my form",
    "properties":
        {
            "name": { "type":"string","title":"Model", "default": "Ziummmm"},
            "description": { "type":"string", "title": "Description", "widget": "textarea" }
        },
        "required":["name"]};

const store = (window.devToolsExtension ? window.devToolsExtension()(createStore) : createStore)(reducer)

const showResults = values => {
    window.alert(`You submitted:\n\n${JSON.stringify(values, null, 2)}`)
}

const dest = document.getElementById('form-holder')

ReactDOM.render(
    <Provider store={store}>
        <Liform schema={schema} onSubmit={showResults}/>
    </Provider>,
    dest
)

And, provided that you have a <div id="form-holder">, you should see something like this:

npm.io

Running the Examples

To run the examples in doc/pages/examples, clone this repository, then run:

npm install
webpack

cd doc/pages/examples/simple # (for instance)
node server.js

Material UI

There is a promising work on a theme for Material UI done by samuelbriole

0.9.1

3 years ago

0.9.0

6 years ago

0.7.0

6 years ago

0.6.9

7 years ago

0.6.8

7 years ago

0.6.7

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.15

7 years ago

0.5.14

7 years ago

0.5.13

7 years ago

0.5.12

7 years ago

0.5.11

7 years ago

0.5.10

7 years ago

0.5.9

7 years ago

0.5.8

7 years ago

0.5.7

7 years ago

0.5.6

7 years ago

0.5.5

7 years ago

0.5.4

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.0

7 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago