Forms
Field
Connects labels, controls, help text, and validation.
Usage
Anatomy
The parts and how they nest, taken from the preview above.
Examples
Label and description
Field connects the label and description to its control.
Validation error
This example displays an existing error. The application decides when validation fails and when to clear it.
Compact control
FieldControl provides a compact input for dense forms.
Workspace
Disabled fields communicate that the setting is managed elsewhere.
Reference
Read-only fields remain available for selecting and copying.
Small
Use this size to match the density of the surrounding interface.
Large
Use this size to match the density of the surrounding interface.
Recommendations
| Guidance | Practice |
|---|---|
| Do | Compose the label, control, description, and error together. Explain how to correct an invalid value. |
| Do | Clicking FieldLabel focuses its control. FieldDescription and visible FieldError text describe that control to assistive technology. |
| Do | Static composition can live in a Server Component. Validation functions, bound form state, and event handlers belong in a Client Component. |
Usage boundaries
| Guidance | Boundary |
|---|---|
| Scope | Field connects accessible descriptions. Business rules and server validation remain application responsibilities. |
API reference
Public props from @mizen-labs/ui. Use exported prop types for the complete TypeScript contract.
| Prop | Type | Default | Description |
|---|---|---|---|
| | — | Use either a bound field or the unbound Base UI field contract. |
| | — | Connects a field to an existing Mizen field object. |
| | — | Uses Base UI field state and validation props. |
| | <label> | Labels the associated control. |
| | — | Provides the Base UI control render slot. |
| | <div> | Adds descriptive help text. |
| | <div> | Renders the current validation message. |
| | — | Composes a validity state for bound fields. |