Form
The Form component is used to submit information.
1. Import
KUMUI exports 7 Form-related components:
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@rohitgadekar/kimui";
2. Usage
3. API
3.1 Form
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Content inside the Form component. Typically includes form fields and submit button. | - |
3.2 FormControl
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Content inside the FormControl component. This usually wraps an input element. | - |
3.3 FormDescription
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Content inside the FormDescription component. Typically provides additional information about the form field. | - |
3.4 FormField
| Attribute | Type | Description | Default |
|---|---|---|---|
| control | React.HookForm.Control | The control object from react-hook-form that handles form field state. | - |
| name | string | The name of the form field, used to register it with the form. | - |
| render | function | The function that renders the input field inside the form. | - |
3.5 FormItem
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Content inside the FormItem. Typically includes a label, input, and validation message. | - |
3.6 FormLabel
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Content inside the FormLabel component. Typically the label for the form field. | - |
3.7 FormMessage
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Content inside the FormMessage component. This typically includes error or success messages. | - |