FormField
ImplementedLabel + control wrapper atom. Binds label htmlFor to the child control via cloneElement (injects id, aria-describedby, aria-invalid), renders required asterisk, hint paragraph, and role=alert error paragraph with AlertIcon fallback. Supports read-only display mode (label above rendered value, mono code option) and flex width slots for FormRow composition.
src/components/atoms/FormField/FormField.tsxProps
FormField
labelstring—Field label rendered above the control
childrenReact.ReactNode—The form control (cloned with id/aria wiring)
htmlForstringuseId fallbackExplicit control id (otherwise generated)
errorstring—Error message; renders role=alert paragraph + aria-invalid
errorIconReact.ReactNodeAlertIcon errorLeading icon inside the error paragraph
hintReact.ReactNode—Helper text below the control (hidden when error set)
requiredbooleanfalseShow required asterisk (aria-hidden)
width'default' | 'wide' | 'narrow''default'Flex growth slot inside FormRow
readOnlybooleanfalseRender as read-only display value instead of input
monobooleanfalseRender read-only value inside <code> (slugs, ids)
<FormField />Accessibility
ARIA
1 ruleUsage
Import
import { FormField } from "@epasslive/design-system"Example 1
<FormField label="Name" required><Input /></FormField>Example 2
<FormField label="Slug" readOnly mono>{slug}</FormField>