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 action | Behaviour |
|---|---|
| Label | The control's accessible name (aria-labelledby or htmlFor). |
| description | Read after the name, linked with aria-describedby. |
| error | Sets 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.