0.0.13 • Published 11 days ago

react-structured-form v0.0.13

Weekly downloads
-
License
-
Repository
-
Last release
11 days ago

React Structured Form

License

Description

Form templating component for React.

Table of Contents

  1. Description
  2. Table of Contents
  3. Installation
  4. Usage
  5. TODOList
  6. License

Installation

npm install react-structured-form -D

Usage

import {Form} from 'react-structured-form';

export default function App(){
	<Form
		properties={[{
			type: 'text',
			name: 'contacts-title',
			label: 'Title',
			required: true,
			max: 255,
		}, {
			type: 'group',
			name: 'contacts',
			label: 'Contacts',
			model: [{
				type: 'iterable-group',
				name: 'friends',
				label: 'Friends',
				model: [{
					type: "text",
					name: "name",
					label: "Name",
					required: true,
				}, {
					type: "email",
					name: "email",
					label: "Email",
					required: true,
				},]
			}, {
				type: 'iterable-group',
				name: "workplace",
				label: "Workplace",
				model: [{
					type: "text",
					name: "name",
					label: "Name",
					required: true,
				}, {
					type: "email",
					name: "email",
					label: "Email",
					required: true,
				},],
			}],
		}, {
			type: 'checkbox',
			name: 'terms',
			suffix: 'Accept terms and conditions',
			required: true,
		}] as const}
		primary={{ 
		label: "submit", 
		onClick: (e) => { alert(`data:${JSON.stringify(e)}`); } 
		}}
	/>
};

TODOList

Guidelines for contributing to your project.

License

This project is licensed under the MIT License.

0.0.12

11 days ago

0.0.13

11 days ago

0.0.10

3 months ago

0.0.11

3 months ago

0.0.9

3 months ago

0.0.8

3 months ago

0.0.5

3 months ago

0.0.4

3 months ago

0.0.7

3 months ago

0.0.6

3 months ago

0.0.3

3 months ago

0.0.1

3 months ago

0.1.0

3 months ago

0.1.2

3 months ago

0.0.2

3 months ago

0.1.1

3 months ago

1.0.0

5 months ago