@dcorp/web-form
TypeScript icon, indicating that this package has built-in type declarations

2.0.11 • Public • Published

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>

Readme

Keywords

none

Package Sidebar

Install

npm i @dcorp/web-form

Weekly Downloads

19

Version

2.0.11

License

none

Unpacked Size

175 kB

Total Files

6

Last publish

Collaborators

  • xuanhao
  • dcorp.developer