Form
Organize fields, labels and validation feedback, and collect form data.
Submission and validation
Label widths
Extended features
Form API
FormField API
Types
Import types when defining reusable component props or assembling options.
Usage notes
By default, all labels in one Form use the width of its widest label. Widths update when text, fonts or mounted fields change. Vertical layouts and narrow screens stack labels above fields. Standard form attributes such as action, method, onSubmit and onReset are supported.
Help and error messages occupy normal layout space and preserve the form gap before the next field. Wrapped text naturally adds height.
Read named controls with FormData. Use required, type and minLength for basic validation; errors appear beside their fields. Pass application or server errors through error. Set noValidate when handling validation yourself. FormData contains strings, does not build nested objects, and omits unchecked checkboxes. Reset controlled fields in application state.
Extension types
FormGroupProps API
FormListProps API
FormListField API
FormListOperations API
FormErrorSummaryProps API
FormError API
React Hook Form integration
Install react-hook-form in your application. Use register with native inputs and Controller with components whose onChange returns a value. Leaf Form handles layout; the form library owns validation and state. Use noValidate to take over validation. FormList names are plain field names; use useFieldArray when React Hook Form manages the collection.