Skip to content

A responsive Next.js/React.js app that dynamically generates interactive forms according to JSON input. Supports modern form features like tabs, toggle switches, and conditional rendering.

Notifications You must be signed in to change notification settings

StrixROX/JSON-Form-Generator

Repository files navigation

image

Website GitHub repo size

A responsive Next.js app that generates dynamic forms from JSON UI schemas

How to use

To clone and run this application, you will need the following programs installed on your system:

  • Git (v2.25.1 used for this project)
  • Node.js (v16.15.1 used for this project)
# clone the repository
$ git clone https://github.com/StrixROX/JSON-Form-Generator.git

# go into the repository
$ cd JSON-Form-Generator

# install dependencies using either
$ npm install # OR yarn install

# start the development server
$ npm run dev # OR yarn run dev

The app should now be accessible by opening https://localhost:3000 (unless stated otherwise in the terminal output) in your browser.

NOTE: There is only one route / in the app. This is a single page application (SPA).

Building

# creates an optimized production build of your application
$ npm run build # OR yarn run build

# run the built app
$ npm run start

Usage

First Run

On the first run, the app will look like this image

Entering schema

On the left side, you can enter the JSON schema for the form and it will be rendered on the right side as you type

Click on the magic wand 🪄 icon to prettify the input JSON image

Form Preview

Form is rendered on the right as you type the schema. image NOTE: The Reset and Submit buttons appear automatically and don't need to be specified in the schema.

Form Buttons

Click on the Reset button to reset the form to its default state as specified in the schema. image

Clicking on the Submit button will display the data collected by the form on the right side. image

Technologies Used

This project was made using

  • Next.js v13 (Docs)
  • React.js v18 (Docs)
  • Tailwind v3 (Docs)
  • Tailwind Scrollbar (Repo)
  • UI Components inspired by Flowbite v3 (Docs)

More Information

For details on supported form elements and respective schema definitions, check out the Wiki.

To learn more about Next.js, take a look at the following resources:

Please report any bugs in Issues

About

A responsive Next.js/React.js app that dynamically generates interactive forms according to JSON input. Supports modern form features like tabs, toggle switches, and conditional rendering.

Topics

Resources

Stars

Watchers

Forks