@dcorp/web-form
v2.0.0
Published
### Installation
Downloads
664
Readme
Getting Started
Installation
yarn add @dcorp/web-form
Usage
import {Form, FormLabelCol, FormItem, FormWrapperCol, FormControl, FormMessage} from "@dcorp/web-form"
return <Form{...form}>
<form
onSubmit={form.handleSubmit((value) => {
alert(JSON.stringify(value))
})}
>
<FormField
control={form.control}
name="fullname"
render={({field}) => (
<FormItem>
<FormLabelCol>
<FormLabel
isRequired
tooltip="This is your full name."
>
Full name
</FormLabel>
</FormLabelCol>
<FormWrapperCol>
<FormControl>
<Input
autoFocus
{...field}
placeholder="Enter your full name"
autoComplete="off"
/>
</FormControl>
<FormMessage/>
</FormWrapperCol>
</FormItem>
)}
/>
<Button type="submit">Submit</Button>
</form>
</Form>