{"id":14156553,"url":"https://github.com/vip-git/universal-json-schema","last_synced_at":"2025-05-16T06:05:48.156Z","repository":{"id":37420538,"uuid":"140337158","full_name":"vip-git/universal-json-schema","owner":"vip-git","description":":scroll: Universal JSON Schema Form - Currently Support for React - Material UI components for building Web forms from JSON Schema.","archived":false,"fork":false,"pushed_at":"2025-05-06T16:29:33.000Z","size":12176,"stargazers_count":154,"open_issues_count":49,"forks_count":20,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-06T17:39:42.367Z","etag":null,"topics":["interceptors","json-schema","json-schema-form","jsonschema-form","material-ui","material-ui-advanced-forms","material-ui-forms","model-driven-forms","mui","react","reference-schema","ui-schema","uischema","xhr-schema","xhrschema"],"latest_commit_sha":null,"homepage":"https://react-jsonschema-form-material-ui.github56.now.sh/","language":"TypeScript","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/vip-git.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"contributing.md","funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"vip-git","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-07-09T20:12:55.000Z","updated_at":"2024-12-06T15:45:55.000Z","dependencies_parsed_at":"2023-02-12T11:16:22.608Z","dependency_job_id":"920b56ae-b3f9-4207-a3ce-dc0da4c3fcdb","html_url":"https://github.com/vip-git/universal-json-schema","commit_stats":{"total_commits":1438,"total_committers":12,"mean_commits":"119.83333333333333","dds":0.2350486787204451,"last_synced_commit":"6ac71e9e779dcf4c43b99002a78ec0bcac94caf0"},"previous_names":["vip-git/react-jsonschema-form-material-ui"],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vip-git%2Funiversal-json-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vip-git%2Funiversal-json-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vip-git%2Funiversal-json-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vip-git%2Funiversal-json-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vip-git","download_url":"https://codeload.github.com/vip-git/universal-json-schema/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478188,"owners_count":22077676,"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":["interceptors","json-schema","json-schema-form","jsonschema-form","material-ui","material-ui-advanced-forms","material-ui-forms","model-driven-forms","mui","react","reference-schema","ui-schema","uischema","xhr-schema","xhrschema"],"created_at":"2024-08-17T08:06:24.947Z","updated_at":"2025-05-16T06:05:47.933Z","avatar_url":"https://github.com/vip-git.png","language":"TypeScript","funding_links":["https://github.com/sponsors/vip-git"],"categories":["react"],"sub_categories":[],"readme":"# React Json Schema Form \\(Mui\\)\n```\nThis Project will soon become a umbrella repo for JSON Schema Support to major Frameworks and UI Frameworks. \n```\nMore info on this has been outlined in [Universal JSON Schema](./universal-json-schema.md) document.\n#\n[![codecov](https://codecov.io/gh/vip-git/react-jsonschema-form-material-ui/branch/main/graph/badge.svg?token=NAyWIbQN4g)](https://codecov.io/gh/vip-git/react-jsonschema-form-material-ui) [![Known Vulnerabilities](https://snyk.io/test/github/vip-git/react-jsonschema-form-material-ui/badge.svg?targetFile=package.json)](https://snyk.io/test/github/vip-git/react-jsonschema-form-material-ui?targetFile=package.json) [![GitHub package.json version](https://img.shields.io/github/package-json/v/vip-git/react-jsonschema-form-material-ui?style=plastic)](https://github.com/vip-git/universal-json-schema) [![npm](https://img.shields.io/npm/dt/react-jsonschema-form-material-ui)](https://www.npmjs.com/package/react-jsonschema-form-material-ui) [![GitHub issues](https://img.shields.io/github/issues/vip-git/react-jsonschema-form-material-ui)](https://github.com/vip-git/react-jsonschema-form-material-ui/issues/) [![GitHub pull requests](https://img.shields.io/github/issues-pr/vip-git/react-jsonschema-form-material-ui)](https://github.com/vip-git/react-jsonschema-form-material-ui/pulls/)\n \n\n[![Build and Test CI](https://github.com/vip-git/universal-json-schema/actions/workflows/node.js.yml/badge.svg)](https://github.com/vip-git/universal-json-schema/actions/workflows/node.js.yml) [![BrowserStack Status](https://automate.browserstack.com/badge.svg?badge_key=MzZ5RE5vdml6Yk5EM0JTZ3l5cGxJKzVLRWlqNVdHbDkzdkprejFkSWZtZz0tLTdxdGFIY3F5a2pXSmNMM2ZLaVMwQ3c9PQ==--74a6da6f146182f21dbe380708e81c257b1cefab%)](https://automate.browserstack.com/public-build/MzZ5RE5vdml6Yk5EM0JTZ3l5cGxJKzVLRWlqNVdHbDkzdkprejFkSWZtZz0tLTdxdGFIY3F5a2pXSmNMM2ZLaVMwQ3c9PQ==--74a6da6f146182f21dbe380708e81c257b1cefab%) [![Build Status](https://app.eu-central-1.saucelabs.com/buildstatus/vtsauce)](https://app.eu-central-1.saucelabs.com/builds/d31c750a8b0944d8ae40ac02038fb574)\n\nA [**Material UI**](http://www.material-ui.com/) port of [**jsonschema-form.**](https://json-schema.org/)\n\nA [**live playground**](https://react-jsonschema-form-material-ui.github56.now.sh/) and [**Detailed Docs**](https://docs.universal-json-schema.com/universal-json-schema/platform/web/react/material-ui)\n\n## Install instructions via npm (MUI 5+)\n\n```text\nnpm install --save react-jsonschema-form-material-ui\n```\n\u003eFollow [Releases page](https://github.com/vip-git/universal-json-schema/releases) to use latest or preleased tags.\n\n#### For legacy version of \u003c MUI 4 \n```text\nnpm install --save react-jsonschema-form-material-ui@3.0.0-mui-4\n```\n\n## Basic Example Usage\n```jsx\n// Library\nimport React from 'react';\nimport MaterialJsonSchemaForm from 'react-jsonschema-form-material-ui';\n\n// Internals\nimport schema from '../simple/schema.json';\nimport uiSchema from '../simple/ui-schema.json';\nconst givenXhrSchema = require('./path-to your-xhr-schema.json'); // Optional\nimport givenFormData from '../simple/form-data.json';\n\nexport default () =\u003e {\n  const [formData, setFormData] = React.useState(givenFormData);\n  \n  return \u003cMaterialJsonSchemaForm \n            schema={schema} \n            uiSchema={uiSchema} \n\t    xhrSchema={givenXhrSchema || {}} // Optional\n\t    theme={} // Optional - You need to explicitly provide your custom theme from MUI5 onwards\n            formData={formData} \n            onChange={({ formData }) =\u003e setFormData(formData)}\n            onSubmit={(submittedData) =\u003e console.log('form submitted', submittedData)}\n          /\u003e;\n};\n```\n\n## Advanced Example Usage\n\n\u003e More detailed example can be seen [here](https://github.com/vip-git/universal-json-schema/blob/main/demo/web/react/body/Example.jsx#L39)\n\n```jsx\n// Library\nimport React from 'react';\nimport MaterialJsonSchemaForm from 'react-jsonschema-form-material-ui';\n\n// Internals\nconst givenSchema = require('./path-to your-schema.json');\nconst givenUISchema = require('./path-to your-ui-schema.json');\nconst givenXhrSchema = require('./path-to your-xhr-schema.json');\nconst givenFormData = require('./path-to your-ui-formData.json');\n\nconst Example () =\u003e {\n    \n    const [formData, setFormData] = React.useState(givenFormData);\n    \n    const onSubmit = (value, callback) =\u003e {\n        console.log('onSubmit: %s', JSON.stringify(value)); // eslint-disable-line no-console\n        setTimeout(() =\u003e callback \u0026\u0026 callback(), 2000); // just an example in real world can be your XHR call\n    }\n    \n    const onCancel = () =\u003e {\n        console.log('on reset being called');\n    }\n    \n    const onFormChanged = ({ formData }) =\u003e setFormData(formData);\n    \n    const onUpload = (value) =\u003e {\n        console.log('onUpload: ', value); // eslint-disable-line no-console\n    }\n    \n    return (\n         \u003cMaterialJsonSchemaForm\n\t    // Define Schema\n\t    schema={givenSchema}\n\t    uiSchema={givenUISchema}\n\t    xhrSchema={givenXhrSchema || {}}\n            formData={formData}\n\t    theme={} // Optional - You need to explicitly provide your custom theme from MUI5 onwards\n\t    \n\t    // Define Event handlers\n            onChange={onFormChanged} \n\t    onSubmit={onSubmit}\n\t    \n\t    // Every Prop below is optional - every prop above this line is required\n            onCancel={onCancel} /* optional */\n\t    onUpload={onUpload} /* optional */\n            onError={onError} /* optional */\n\t    \n            /* Optional Prop for custom functions to be executed for transforming data */\n            interceptors={{\n                translateRatings: (givenData, uiData) =\u003e ({ givenData, uiData }),\n            }}\n\t    \n            /* Optional Prop for custom components */\n\t    components={{\n\t\t  customComponent: ({ onChange, ...rest }) =\u003e (\n\t\t\t\u003cCustomComponent onChange={onChange} formData={givenFormData} uiData={givenUIData} {...rest} /\u003e\n\t\t  ),\n\t\t  customRating: ({ onChange, ...rest }) =\u003e (\n\t\t\t\u003cCustomRating onChange={onChange} formData={givenFormData} uiData={givenUIData} {...rest} /\u003e\n\t\t  ),\n\t    }}\n\t    \n            /* Optional Prop for custom validation */\n            validations={{\n                confirmPassword: ({ schema, validations, formData, value }) =\u003e value !== formData.pass1 \u0026\u0026 ({\n\t\t      message: validations.confirmPassword.message,\n\t\t      inline: true,\n                }),\n            }}\n\t    \n            /* Optional Prop to auto submit form on press of enter */\n\t    submitOnEnter\n\t/\u003e\n    );\n}\n\nexport default Example;\n```\n\n## Latest Version [![npm version](https://badge.fury.io/js/react-jsonschema-form-material-ui.svg)](https://react-jsonschema-form-material-ui.github56.now.sh) \\[JSONSchema-Draft-7 Support]\n\n- Build system now upgraded to webpack 5\n- React select values are no longer stringify results but array values.\n- New Tabs UI to divide sub sections to tabs\n- Additional Properties and Additional Items feature enabled\n- `\"ui:options\"` and `\"ui:style\"` enabled for prop passing and styling every field\n- On the fly module creation\n- Reference Schema's via http and inline references\n- Support alternatives - `oneOf`, `anyOf`, `allOf`\n- Support for dependencies - array of conditionals\n- new Prop `onError` to get errors available in form on every change\n- new Prop `uiData` to control ui only data to add separation of concern with form data\n- Demo updated with monaco editor and live validation changes\n- New interceptors to transform form and uiData using uiSchema - `ui:interceptor`\n\n\u003e For more info you can follow our [changelog](https://github.com/vip-git/universal-json-schema/blob/main/changelog.md)\n\n## Contributing \n\u003e We welcome [all contributions](/contributing.md), enhancements, and bug-fixes. \n\u003e Open an [issue on GitHub](https://github.com/vip-git/universal-json-schema/issues) and submit a [pull request](https://github.com/vip-git/universal-json-schema/pulls).\n\n#### Building/Testing\nTo build/test the project locally on your computer:\n\n\u003e Fork this repo and then clone\n```\ngit clone https://github.com/vip-git/universal-json-schema.git\n```\n\n\u003e Install dependencies and module generator\n```\nnpm install\n```\n\n\u003e Run the demo to test your changes\n```\nnpm start (open http://localhost:3005 once build is successful)\n```\n\n\u003e Run the tests once you are done with your changes\n```\nnpm test\n```\n\nYou can send a PR through and a release will be made following [Semantic Versioning](https://semver.org/) once your PR gets merged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvip-git%2Funiversal-json-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvip-git%2Funiversal-json-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvip-git%2Funiversal-json-schema/lists"}