@dynamo-ny/react-form
v0.1.16
Published
react components library
Downloads
1
Readme
@dynamo-ny/react-form
react components library
Install
npm install @dynamo-ny/react-form
or
yarn add @dynamo-ny/react-form
Usage
import '@dynamo-ny/react-form/dist/index.css'
import React from 'react'
import {
Form,
TextField,
NumberField,
DateField,
Checkbox,
TextareaField,
Select,
RadioButtonGroup,
SubmitButton,
ResetButton,
} from '@dynamo-ny/react-form'
const submit = (data) => {
// do smth, return a promise
}
export const TestForm = () => (
<Form onSubmit={submit}>
<TextField name="name" label="Name" placeholder="John Doe" required />
<NumberField name="price" label="Price" required />
<DateField name="dob" label="Date of Birth" required />
<TextareaField name="TextareaField" label="TextareaField" placeholder="placeholder" required />
<Select name="gender" label="Gender" options={['male', 'female']} />
<RadioButtonGroup
name="radios"
label="Buttons example"
required
options={['alpha', 'beta', 'gamma']}
/>
<Checkbox name="agree" label="Agree?" required />
<footer>
<ResetButton>reset</ResetButton>
<SubmitButton>submit</SubmitButton>
</footer>
</Form>
)
License
MIT