Form
Highly configurable react-hook-form layout with a11y and field arrays.
When to use
Use Form when you need highly configurable react-hook-form layout with a11y and field arrays.
Import
TypeScript
import { Form } from '@gzodo/ui'Form is configured at the root: density, orientation, size, label width, required mark, status colors, message placement, and classNames slots. Fields inherit those defaults and can override them. Spread controlProps onto controls for id, aria-*, disabled, color, and size.
Examples
5Field
Minimal profile form with
Form.Submit wired to isSubmitting.Configurable
Horizontal labels, shared
size, and actions aligned with actionsAlign.Error message
Forced error status paints the label and control with the danger color.
Success
Success status via
status and message.Complete
Full-width demo with
Section, Row, and FieldArray.Form config
11Form config
Property
Description
Type
Default
densitySpacing scale for gaps and padding.
'compact' | 'default' | 'comfortable''default'orientationDefault field layout. Fields can override.
'vertical' | 'horizontal''vertical'sizeDefault control size passed through controlProps.
'sm' | 'md' | 'lg' | 'xl'—
labelWidthHorizontal label column width. Number = px.
number | string—
requiredIndicatorRequired mark. false hides it.
ReactNode | false'*'keepDescriptionOnErrorKeep helper text when an error is visible.
booleanfalseapplyStatusColorMap status onto controlProps.color.
booleantruemessagePlacementWhere description/message sit relative to the control.
'below' | 'above''below'classNamesSlot classes: root, field, label, control, message, section, row, actions, summary…
FormClassNames—
actionsAlignDefault Form.Actions alignment.
'start' | 'center' | 'end' | 'between''end'formatError / showSuccessDefaults inherited by every Form.Field.
…—
Form.Field
5Form.Field
Property
Description
Type
Default
orientation / size / …Any form config key can be overridden per field.
overrides—
classNamesfield, label, title, required, control, description, message.
FormFieldClassNames—
renderLabel / renderDescription / renderMessageReplace default markup while keeping ids/status.
slots—
hideDescription / hideMessageForce-hide helper or status text.
boolean—
controlPropsid, aria-*, disabled, color, size. Spread onto the control.
FormControlProps—
Helpers
6Helpers
Property
Description
Type
Default
Form.SectionGrouped fields.
title?, description?, classNames?—
Form.RowResponsive field grid.
columns?, gap?—
Form.ActionsFooter actions.
align?—
Form.SummarySubmit error list.
showOnMount?, renderItem?—
Form.FieldArrayDynamic lists.
useFieldArray—
Form.SubmitSubmit with isSubmitting loading.
Button—