Skip to content
uiify

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

Password

Use at least eight characters.

Message

Up to 500 characters.

Disabled

Read only

API

Field.Root

PropTypeDefaultDescription
id*string—Stable id every part passes back as fieldId, so label, control, description and error are wired together in the server markup.
invalidbooleanfalseMarks the field invalid, exposing data-invalid for styling.
requiredbooleanfalseMarks the field required, exposing data-required for styling.
disabledbooleanfalseMarks the field disabled, exposing data-disabled for styling.
namestring—Accepted for API compatibility; the name belongs on the control and is not rendered on the wrapper.
renderReactElement | ((props, state) => ReactElement)—Replace the rendered element while keeping behavior and accessibility wiring.

Field.Label

PropTypeDefaultDescription
fieldId*string—The same id given to Field.Root, which resolves the htmlFor pointing at the control.
disabledbooleanfalseMarks the label disabled, exposing data-disabled for styling.
requiredbooleanfalseMarks the label required, exposing data-required for styling.

Field.Control

PropTypeDefaultDescription
asElementType"div"Use input, textarea, select or a custom control. Native props, event handlers, style and ref are forwarded.
type / name / autoComplete / minLength / maxLength / pattern / readOnlynative 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.
disabledbooleanfalseForwards native disabled to input, textarea and select and exposes data-disabled.
invalidbooleanfalseSets aria-invalid and adds the error message to the control's aria-describedby.
requiredbooleanfalseForwards native required to input, textarea and select, and sets aria-required.
renderReactElement | ((props, state) => ReactElement)—Replace the rendered element while keeping behavior and accessibility wiring.

Field.Description

PropTypeDefaultDescription
fieldId*string—The same id given to Field.Root, which resolves the description id the control points at.
disabledbooleanfalseMarks the description disabled, exposing data-disabled for styling.

Field.Error

PropTypeDefaultDescription
fieldId*string—The same id given to Field.Root, which resolves the error id the control points at when invalid.
invalidbooleanfalseRenders the error message; the part renders nothing while this is false.

Keyboard

KeyAction
TabMove focus to/from the control
Enter / SpaceActivate 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