1.0.15 • Published 4 years ago

@fasst/form v1.0.15

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

fasst-form npm version

Npm library for form rendering in React

react tested with jest

Available frameworks :

Available Form inputs :

  • Button
  • Checkbox
  • DatePicker
  • Radio
  • Select
  • SirenInput
  • Switch
  • TextArea

Import fasst-form into your project

import FasstForm, { validateSchema } from 'fasst-form';

Generating a Form from JSON or YAML scheme

JSON scheme :


{ 'formStyle': { //'width': '300px' }, 'items': { 'id': 'firstname', 'component': 'input', 'label': 'Prénom', 'props': { 'type': 'text' } }, { 'id': 'email', 'component': 'input', 'label': 'Email', 'props': { 'type': 'email' } }, { 'id': 'checkbox', 'component': 'checkbox', 'label': 'Checkbox' }, { 'id': 'switch', 'component': 'switch', 'label': 'Switch' }, { 'id': 'select1', 'component': 'select', 'label': 'Select n°1' }, { 'id': 'confirm', 'component': 'button', 'label': 'Valider' } }

Using the following code in React :


<FasstForm
	framework={'antd'}
	schema={schema}      
	observers={{
		lastname: (v) => console.log('lastname', v.target.value),
		firstname: (v) => console.log('firstname', v.target.value),
		confirm: () => console.log('ok')
	}}
	sets={{
		select1: [{ label: 'Option n°1', value: 'option1' }, { label: 'Option n°2', value: 'option2' }, { label: 'Option n°3', value: 'option3' }],
		select2: [{ label: 'Option n°4', value: 'option4' }, { label: 'Option n°5', value: 'option5' }, { label: 'Option n°6', value: 'option6' }]
	}}
/>
1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago