Form

Form components that integrate with react-hook-form to provide accessible form controls with built-in validation and error handling.

This is your public display name.

Control appears before the label.

Installation

1. Follow the links to install required rlx packages

PackageTypeLink
@rlx-widgets/checkboxWidget
@rlx-widgets/inputWidget
@rlx-widgets/selectWidget
@rlx-widgets/textareaWidget
@rlx-widgets/fieldWidget

2. Install the following dependencies

Loading...

bash

API Reference

Common props for all form components

PropTypeDefaultDescription
control-React Hook Form control object from useForm()
namestring-The name of the field in the form schema
labelReactNode-The label text displayed for the field
descriptionReactNodeundefinedOptional description text displayed below the label
placeholderstringundefinedOptional placeholder text for input, textarea, and select fields
controlFirstbooleanfalseWhen true, renders the control before the label (useful for checkboxes)
horizontalbooleanfalseWhen true, displays the field in a horizontal layout

FormSelect specific props

PropTypeDefaultDescription
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.