Skip to Content
glob.ui home
Components

Field

Wraps one form control with a label, a description and an error, and wires their ARIA attributes to it.

Server componentNo state or handlers. Safe to render in a Server Component.
import { Field } from "@glob-ui/field"

Preview

Lowercase letters and numbers.

Examples

Error

An error marks the control aria-invalid and links the message with aria-describedby. required shows the asterisk and sets required on the control.

This username is taken.

API

Props are generated from the TypeScript types in the package source.

FieldProps

Prop

Type

Accessibility

Key or actionBehaviour
LabelThe control's accessible name (aria-labelledby or htmlFor).
descriptionRead after the name, linked with aria-describedby.
errorSets aria-invalid="true" and is linked with aria-describedby, so it is announced with the control.

ARIA. Field passes its ids to the child with cloneElement. A child's own aria-describedby is kept and extended, not replaced.

On this page