talira

react-jsonschema-form

A React component that builds web forms from a JSON Schema.

open sourceApache-2.0self-hostablefree

react-jsonschema-form (RJSF) renders a complete React form from a JSON Schema: give it the schema and a validator and it generates the fields, validates input and hands back the data, so you can build forms for data you haven't seen in advance. A uiSchema and form props customise layout, widgets and behaviour beyond the default look. Themes match Ant Design, Chakra UI, daisyUI, Fluent UI, Mantine, Material UI, React-Bootstrap and shadcn/ui, and validation plugs in through AJV 8, ata or the Cloudflare Workers validator. The maintainers say it suits generating forms for arbitrary schemas; for data you know in advance, a form toolkit may fit better. It started as a Mozilla Services project.

Problems it solves

  • generate a form in React from a JSON Schema
  • build admin forms for configuration objects without writing every field by hand
  • our backend already has JSON Schemas and I don't want to duplicate them as form code
  • render forms for user-defined data structures I don't know in advance
  • validate form input against the same JSON Schema the API uses
  • a schema-driven form that uses Material UI or Ant Design components

Features

  • forms generated from JSON Schema
  • uiSchema for layout and widget customisation
  • pluggable validators: AJV 8, ata, Cloudflare Workers
  • themes for Ant Design, Chakra UI, daisyUI, Fluent UI, Mantine, Material UI, React-Bootstrap and shadcn/ui
  • live playground
  • TypeScript types

Limitations

  • The latest version requires React 19.2 or later.1