{"id":13516096,"url":"https://github.com/networknt/react-schema-form","last_synced_at":"2025-07-06T07:34:27.020Z","repository":{"id":2759570,"uuid":"42025200","full_name":"networknt/react-schema-form","owner":"networknt","description":"react form based on json schema for form generation and validation","archived":false,"fork":false,"pushed_at":"2025-02-23T04:12:58.000Z","size":12340,"stargazers_count":357,"open_issues_count":20,"forks_count":95,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-25T06:45:46.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/networknt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-07T01:29:13.000Z","updated_at":"2025-02-23T04:13:01.000Z","dependencies_parsed_at":"2023-01-13T16:22:28.671Z","dependency_job_id":"ec1a052c-ca39-4eb9-996e-1f4f15e35b27","html_url":"https://github.com/networknt/react-schema-form","commit_stats":{"total_commits":590,"total_committers":39,"mean_commits":"15.128205128205128","dds":0.6016949152542372,"last_synced_commit":"7413c9be1042a1518d6fcb8669354dab27d0d61b"},"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Freact-schema-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Freact-schema-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Freact-schema-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Freact-schema-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/networknt","download_url":"https://codeload.github.com/networknt/react-schema-form/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246423527,"owners_count":20774795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T05:01:19.094Z","updated_at":"2025-03-31T05:31:16.145Z","avatar_url":"https://github.com/networknt.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# react-schema-form\n\n[![Join the chat at https://gitter.im/networknt/react-schema-form](https://badges.gitter.im/networknt/react-schema-form.svg)](https://gitter.im/networknt/react-schema-form?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![CircleCI](https://circleci.com/gh/networknt/react-schema-form.svg?style=svg)](https://circleci.com/gh/networknt/react-schema-form)\n\n[![npm package](https://img.shields.io/npm/v/react-schema-form.svg?style=flat-square)](https://www.npmjs.org/package/react-schema-form)\n\n[React](http://facebook.github.io/react/) forms based on json schema for form generation and validation. This is a port of the [angular schema form](https://github.com/Textalk/angular-schema-form) project using\n[material-ui](http://www.material-ui.com/) for the underlying components.\n\n# Live demo\n[demo](http://networknt.github.io/react-schema-form/)\n\nWhile you are trying the demo forms, you can update the schema and form in the json editor to see the instant re-rendered form. This is a way to build form interactively.\n\n# Examples\n\nIf you don't have babel-cli installed globally, please do it first.\n\n```\nsudo npm install -g babel-cli\n```\n\nClone the project and run\n\n```\ncd react-schema-form\nnpm install\ncd example\nyarn\nnpm start\n```\n\nThen open localhost:8080 in a browser.\n\n# Installation\n\n```sh\nnpm install react-schema-form --save\n```\n\nThere is one added on component react-schema-form-rc-select for multiple select and dynamically loading dropdown from server. To install it.\n```\nnpm install react-schema-form-rc-select --save\n```\n\n# Usage\n```js\nvar { SchemaForm } = require('react-schema-form');\n\n\u003cSchemaForm schema={this.state.schema} form={this.state.form} model={this.props.model} onModelChange={this.props.onModelChange} /\u003e\n\n// for example:\n_onChange: function() {\n    this.setState({\n        schema: FormStore.getForm('com.networknt.light.example').schema,\n        form: FormStore.getForm('com.networknt.light.example').form\n    });\n}\n```\n# Examples\n\nThere are some simple forms in the demo to show how each fields to be rendered.\nFor more real world exmaples, please check [Light Framework Forms](https://github.com/networknt/light/tree/master/server/src/main/resources/form)\n\nThere are still some angular schema form in this folder and migration is in progress.\n\nIf you are interested in how these forms are utilized in the framework, please take a look at a react component [Form.jsx](https://github.com/networknt/light/blob/master/edibleforestgarden/src/app/components/Form.jsx)\n\nBasically, All forms in this folder will be loaded to an Graph Database and UI is rendered by formId and form model will be validated on the browser as well as\nbackend APIs.\n\n# Form format\n\nReact-schema-form implements the form format as defined by the json-schema-form standard.\n\nThe documentation for that format is located at the [json-schema-form wiki](https://github.com/json-schema-form/json-schema-form/wiki/Documentation).\n\n# Customization\nreact-schema-form provides most fields including FieldSet and Array and they might cover most use cases; however, you might have requirement that needs something that is not built in. In this case, you\ncan implement your own field and inject it into the generic mapper for the builder to leverage your component. By passing a mapper as a props to the SchemaForm, you can replace built in component with\nyours or you can define a brand new type and provide your component to render it.\n\n[react-schema-form-rc-select](https://github.com/networknt/react-schema-form-rc-select) is an example to provide multiple select to the react schema form.\n\n```js\nrequire('rc-select/assets/index.css');\nimport RcSelect from 'react-schema-form-rc-select/lib/RcSelect';\n...\n\n        var mapper = {\n            \"rc-select\": RcSelect\n        };\n\n        var schemaForm = '';\n        if (this.state.form.length \u003e 0) {\n            schemaForm = (\n                \u003cSchemaForm schema={this.state.schema} form={this.state.form} model={this.state.model} onModelChange={this.onModelChange} mapper={mapper} /\u003e\n            );\n        }\n\n\n```\n\n# Error Handler\n\nThe error handler is disabled by default but you can enable it by using showErrors prop on `SchemaForm`.\n\n```js\n...\nonValidate = () =\u003e {\n    if (form is valid) {\n        ...\n    } else {\n        this.setState({ showErrors: true });\n    }\n}\n\n...\n    \u003c\u003e\n        \u003cSchemaForm\n            schema={schemaObject}\n            form={formObject}\n            model={modelObject}\n            onModelChange={this.onModelChange}\n            mapper={mapperObject}\n            showErrors={this.state.showErrors}\n        /\u003e\n        \u003cButton onClick={this.validate}\u003eSubmit\u003c/Button\u003e\n    \u003c/\u003e\n```\n\n\n# Contributing\n\nSee our [CONTRIBUTING.md](https://github.com/networknt/react-schema-form/CONTRIBUTING.md) for information on how to contribute.\n\n\n# License\n\nMIT Licensed. Copyright (c) Network New Technologies Inc. 2020.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworknt%2Freact-schema-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetworknt%2Freact-schema-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworknt%2Freact-schema-form/lists"}