@any-ui/form
Simple, self contained form management
Built on top of React Final Form
Warning
This is an unstable alpha channel of any-ui, find the latest stable release here.
Installation
// with npm
npm install @any-ui/form@next
// with yarn
yarn add @any-ui/form@next
Please note that @next
will only point to pre-releases; to get the latest stable release use @latest
instead.
Example code showing intended use
import {
EmailField,
Form,
FormSubmitHandler,
PasswordField,
TextField,
} from '@any-ui/form'
interface IFormFields {
name: string
password: string
email: string
address: string
}
const handleSubmit: FormSubmitHandler<IFormFields> = async values => {
alert(`Submit success for ${values.name}`)
}
<Form<IFormFields> onSubmit={handleSubmit}>
<TextField
required
autoFocus
name="name"
label="Name" />
<PasswordField
required
name="password"
/>
<EmailField
name="email"
label="Email"
/>
<TextField
name="address"
label="Address"
rows={5}
/>
</Form>
Please note that @next
will only point to pre-releases; to get the latest stable release use @latest
instead.
Documentation
One day....