• Stars
    star
    174
  • Rank 219,104 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generate forms from JSON Schema to use with React (& redux-form)

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:

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

More Repositories

1

ReactBundle

Client and Server-side React.js rendering in a Symfony Bundle
PHP
391
star
2

symfony-react-sandbox

Example of integration with React and Webpack (Webpack Encore) for universal (isomorphic) React rendering, using Limenius/ReactBundle and Limenius/LiformBundle
JavaScript
337
star
3

ReactRenderer

Client and Server-side React rendering from PHP
PHP
239
star
4

LiformBundle

Symfony Bundle to render Symfony Forms to JSON Schema
PHP
135
star
5

Liform

PHP library to render Symfony Forms to JSON Schema
PHP
134
star
6

tictactoe

Example of integration between a React+Redux client side with an Elixir/OTP GenServer
JavaScript
8
star
7

LimeniusAramblaGeneratorBundle

Symfony2 bundle to generate Doctrine2 entities from a RAML spec
PHP
4
star
8

symfony-travolta-tutorial

A practical tutorial of Symfony 4
PHP
3
star
9

workshop-symfony-react

Workshop about Server Side Rendering of React in PHP (Symfony)
PHP
3
star
10

limenius-percentage-slider

[Unmantained] JavaScript slider for percentages. Or segments that add up to a certain value.
JavaScript
3
star
11

LimeniusFilesystemRouterBundle

Symfony router for static html files
PHP
2
star
12

arambla

[WIP] RAML parser written in PHP with a focus on extracting schema information
PHP
2
star
13

liform-sandbox

Sandbox for Liform, Smfony Form serializer into json-schema
PHP
2
star
14

workshop-react-native-2017

Materials for a workshop about React Native
JavaScript
2
star
15

leyelectoral

Graphical visualization of the Spanish Election System. Made in Silex & Backbone
JavaScript
2
star
16

workshop-sagas

sagas workshop React Alicante 2019
JavaScript
2
star
17

beforeNickArrives

Our entry for Ludum Dare 37
JavaScript
1
star
18

LimeniusStackBoilerplateBundle

Stack Layout + HTML5 Boilerplate for Symfony2 users
JavaScript
1
star