Form
Form components that integrate with react-hook-form to provide accessible form controls with built-in validation and error handling.
Installation
1. Follow the links to install required rlx packages
| Package | Type | Link |
|---|---|---|
@rlx-widgets/checkbox | Widget | |
@rlx-widgets/input | Widget | |
@rlx-widgets/select | Widget | |
@rlx-widgets/textarea | Widget | |
@rlx-widgets/field | Widget |
2. Install the following dependencies
Loading...
API Reference
Common props for all form components
| Prop | Type | Default | Description |
|---|---|---|---|
control | - | React Hook Form control object from useForm() | |
name | string | - | The name of the field in the form schema |
label | ReactNode | - | The label text displayed for the field |
description | ReactNode | undefined | Optional description text displayed below the label |
placeholder | string | undefined | Optional placeholder text for input, textarea, and select fields |
controlFirst | boolean | false | When true, renders the control before the label (useful for checkboxes) |
horizontal | boolean | false | When true, displays the field in a horizontal layout |
FormSelect specific props
| Prop | Type | Default | Description |
|---|---|---|---|
items | - | Array of select items with value and label properties |
All form components integrate seamlessly with React Hook Form and automatically handle validation, error display, and field state management. The components follow accessibility best practices and provide consistent styling.