Field
Label/control/error wrapper.
- Browsers
- Chrome 123+Firefox 121+Safari 17.5+
- Tier
- 0
- Bundle compressed
- 668 B
- Forced layout budget
- 0 ms
- Axe budget
- 0
- SSR compatible
- Yes
- Published contract
- Test harness
Playground
Field
Default
Your display name
Invalid
Enter a valid email address
Password
Use at least eight characters.
Message
Up to 500 characters.
Disabled
Read only
API
Field.Root
| Prop | Type | Default | Description |
|---|---|---|---|
id* | string | — | Stable id every part passes back as fieldId, so label, control, description and error are wired together in the server markup. |
invalid | boolean | false | Marks the field invalid, exposing data-invalid for styling. |
required | boolean | false | Marks the field required, exposing data-required for styling. |
disabled | boolean | false | Marks the field disabled, exposing data-disabled for styling. |
name | string | — | Accepted for API compatibility; the name belongs on the control and is not rendered on the wrapper. |
render | ReactElement | ((props, state) => ReactElement) | — | Replace the rendered element while keeping behavior and accessibility wiring. |
Field.Label
| Prop | Type | Default | Description |
|---|---|---|---|
fieldId* | string | — | The same id given to Field.Root, which resolves the htmlFor pointing at the control. |
disabled | boolean | false | Marks the label disabled, exposing data-disabled for styling. |
required | boolean | false | Marks the label required, exposing data-required for styling. |
Field.Control
| Prop | Type | Default | Description |
|---|---|---|---|
as | ElementType | "div" | Use input, textarea, select or a custom control. Native props, event handlers, style and ref are forwarded. |
type / name / autoComplete / minLength / maxLength / pattern / readOnly | native control props | — | Input options belong on Field.Control, including type="password". Standard validation and FormData semantics are preserved. |
fieldId* | string | — | The same id given to Field.Root, which resolves the control id and its aria-labelledby and aria-describedby wiring. |
disabled | boolean | false | Forwards native disabled to input, textarea and select and exposes data-disabled. |
invalid | boolean | false | Sets aria-invalid and adds the error message to the control's aria-describedby. |
required | boolean | false | Forwards native required to input, textarea and select, and sets aria-required. |
render | ReactElement | ((props, state) => ReactElement) | — | Replace the rendered element while keeping behavior and accessibility wiring. |
Field.Description
| Prop | Type | Default | Description |
|---|---|---|---|
fieldId* | string | — | The same id given to Field.Root, which resolves the description id the control points at. |
disabled | boolean | false | Marks the description disabled, exposing data-disabled for styling. |
Field.Error
| Prop | Type | Default | Description |
|---|---|---|---|
fieldId* | string | — | The same id given to Field.Root, which resolves the error id the control points at when invalid. |
invalid | boolean | false | Renders the error message; the part renders nothing while this is false. |
Keyboard
| Key | Action |
|---|---|
| Tab | Move focus to/from the control |
| Enter / Space | Activate when focused (button-like controls) |
Accessibility
Uses semantic HTML where possible. Inspect rendered markup in the playground — ARIA is added only when native elements are insufficient.
Styling hooks
data-disabled