0.0.13 • Published 1 year ago

react-structured-form v0.0.13

Weekly downloads
-
License
-
Repository
-
Last release
1 year 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

1 year ago

0.0.13

1 year ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.3

1 year ago

0.0.1

1 year ago

0.1.0

1 year ago

0.1.2

1 year ago

0.0.2

1 year ago

0.1.1

1 year ago

1.0.0

2 years ago