• Stars
    star
    128
  • Rank 279,992 (Top 6 %)
  • Language
    JavaScript
  • Created over 2 years ago
  • Updated over 2 years ago

Reviews

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

Repository Details

An example of a schema-based form system for React.

React Advanced Form

An example of a schema-based form system in React. Define your schema, and pass it into the form. Supports basic conditional schema.

Example

The schema system support text input, checkbox, radio group, select, textarea, and conditonal fields. It is presented in these examples with plain HTML and CSS based forms, but can easily be modified for use with any React UI framework, such as Material UI, Semantic UI, etc.

const formSchema = [
  { name: 'name', label: 'Name', componentType: 'text', required: true },
  { name: 'playable', label: 'Playable', componentType: 'checkbox' },
  {
    name: 'race',
    label: 'Race',
    componentType: 'radioGroup',
    options: [
      { label: 'Human', value: 'human' },
      { label: 'Dwarf', value: 'dwarf' },
      { label: 'Elf', value: 'elf' },
    ],
  },
  {
    name: 'class',
    label: 'Class',
    componentType: 'select',
    options: [
      { label: 'Ranger', value: 'ranger' },
      { label: 'Wizard', value: 'wizard' },
      { label: 'Healer', value: 'healer' },
    ],
  },
  {
    name: 'spell',
    label: 'Spell',
    componentType: 'select',
    options: [
      { label: 'Fire', value: 'fire' },
      { label: 'Ice', value: 'ice' },
    ],
    condition: { key: 'class', value: 'wizard', operator: '=' },
  },
  {
    name: 'description',
    label: 'Description',
    componentType: 'textarea',
  },
]

Simply pass the schema into the component, and handle the submit event.

<AdvancedForm schema={formSchema} onSubmit={handleSubmit} />

More Repositories

1

takenote

๐Ÿ“ โ€Ž A web-based notes app for developers.
TypeScript
6,824
star
2

webpack-boilerplate

๐Ÿ“ฆ โ€Ž A sensible webpack 5 boilerplate.
JavaScript
2,399
star
3

taniarascia.com

๐Ÿ’พ โ€Ž Personal website running on Gatsby, React, and Node.js.
JavaScript
1,982
star
4

wp-functions

A compilation of function snippets for WordPress developers who create their own themes.
1,206
star
5

new-moon

๐ŸŒ™ โ€Ž The optimized dark theme for web development.
Less
1,205
star
6

primitive

โ›๏ธ โ€Ž A front-end design toolkit for developing web apps.
SCSS
920
star
7

react-tutorial

A walkthrough of basic React concepts.
CSS
738
star
8

mvc

A simple MVC application in plain JavaScript.
JavaScript
575
star
9

sandbox

Development sandbox for front end projects and tutorials.
JavaScript
531
star
10

chip8

๐ŸŽฎ โ€Ž A Chip-8 emulator written in JavaScript for web, CLI, and native UI.
JavaScript
413
star
11

react-hooks

Build a CRUD app in React with Hooks.
JavaScript
371
star
12

laconia

๐Ÿบ โ€Ž A minimalist MVC framework.
PHP
360
star
13

snek

๐Ÿ โ€Ž A terminal-based Snake implementation written in JavaScript.
JavaScript
272
star
14

pdo

Connecting to MySQL in PHP using PDO.
PHP
230
star
15

startwordpress

Learn how to develop a WordPress theme from scratch with this basic skeleton and accompanying tutorial.
PHP
208
star
16

chat

๐Ÿ’ฌ ๐Ÿ• โ€Ž very chat. such messages. so talking. wow. React/Redux, TypeScript, Socket.io chat app.
TypeScript
204
star
17

accordion

๐Ÿช— Play the accordion with your computer keyboard!
JavaScript
174
star
18

vue-tutorial

A walkthrough of basic Vue concepts.
Vue
149
star
19

oblate

Custom theme for my personal website and blog.
PHP
124
star
20

startjekyll

An example and guide to getting started with Jekyll and static site generators.
CSS
115
star
21

memory

โญ โ€Ž JavaScript Memory Game.
JavaScript
110
star
22

node-api-postgres

RESTful API with Node.js, Express, and Postgres.
JavaScript
103
star
23

upload

How to Upload a File to a Server in PHP
PHP
101
star
24

bootstrapblog

Build on the official Bootstrap blog starter template to learn how to make a WordPress theme.
HTML
97
star
25

sokoban

Sokoban.js ๐Ÿ“ฆ
JavaScript
91
star
26

new-moon-vscode

New Moon Theme for Visual Studio Code.
90
star
27

untheme

A blank WordPress theme for developers.
PHP
88
star
28

new-moon-chrome-devtools

New Moon Theme for Chrome Devtools.
CSS
58
star
29

card

A well-designed card element.
CSS
55
star
30

new-moon-sublime

New Moon Syntax Theme for Sublime Text
54
star
31

router-example

Use React Router DOM to create a Single Page Application (SPA).
JavaScript
52
star
32

tictactoe

#๏ธโƒฃ Tic Tac Toe in TypeScript.
TypeScript
42
star
33

baba

JavaScript
31
star
34

node-test

How to make your first Node.js project
JavaScript
26
star
35

new-moon-atom-syntax

New Moon Syntax Theme for Atom
CSS
25
star
36

new-moon-brackets

New Moon Theme for Brackets.
Less
22
star
37

calc

Unit Testing in JavaScript
JavaScript
20
star
38

graphql-fantasy-api

JavaScript
19
star
39

dotfiles

Dotfile configuration.
15
star
40

taniarascia

13
star
41

singularity

An online, text-based dystopian strategy game built in PHP. Modified from the original QMT Promisance code.
PHP
12
star
42

3d

3D printer projects.
10
star
43

coffee

Cafรฉtography
JavaScript
10
star
44

new-moon.vim

port of taniarascias newmoon colorscheme
Vim Script
10
star
45

startgrunt

Learn how to install Grunt and use it to create a Sass and JavaScript workflow.
JavaScript
10
star
46

comments

Comments
7
star
47

httpcast

HTML
5
star
48

signals

Signal test
JavaScript
3
star