Skip to content

Field

A form field wrapper that renders a label, description, control slot, and validation status.

We'll never share your email.
<Field {...args} description="We'll never share your email.">
<input id="field-story" />
</Field>
<Field {...args}>
<input id="field-story" />
</Field>
<Field {...args}>
<input id="field-story" />
</Field>
<Field {...args}>
<input disabled id="field-story" />
</Field>
The label is visually hidden but still accessible.
<Field {...args}>
<input id="field-story" placeholder="Email" />
</Field>
Preference
<Field {...args}>
<div aria-labelledby="pref-label" role="radiogroup">
<label>
<input name="pref" type="radio" /> Email
</label>
<label>
<input name="pref" type="radio" /> Phone
</label>
</div>
</Field>
<Field {...args}>
<input id="field-story" />
</Field>
<Field {...args}>
<input id="field-story" />
</Field>
<Field {...args}>
<input id="field-story" />
</Field>
This email is already in use.
<Field {...args}>
<input id="field-story" />
</Field>
Email is available.
<Field {...args}>
<input id="field-story" />
</Field>
<Field {...args}>
<input id="field-story" />
</Field>
Your primary contact email.
<Field {...args}>
<input id="field-story" />
</Field>

A form field wrapper that renders a label, description, control slot, and validation status.

When isOptional: false, isRequired: false

PropTypeDefaultDescription
children*ReactNodeThe form control rendered inside the field.
classNamestringAdditional CSS class names applied to the root element.
data-testidstringTest ID applied to the root element.
descriptionReactNodeSupporting text rendered between the label and control.
descriptionIDstringID for the description element.
inputId*stringID of the associated control.
isDisabledbooleanfalseWhether the associated control is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label and description.
label*stringField label text.
labelAs'label' | 'span''label'HTML element used for the label. Use 'span' for group controls (e.g., radiogroup) where htmlFor cannot target a labelable element.
labelIconIconComponentOptional icon shown before the label.
labelIdstringID applied to the label element, useful for aria-labelledby.
labelTooltipReactNodeTooltip content shown next to the label.
refRef<HTMLDivElement>Ref forwarded to the root element.
statusFieldStatusValidation status displayed below the control.
statusVariant"attached" | "detached"'attached'How the status message is positioned.
styleCSSPropertiesInline styles applied to the root element.
isOptionalfalse
isRequiredfalse

When isOptional: true, isRequired: false

PropTypeDefaultDescription
children*ReactNodeThe form control rendered inside the field.
classNamestringAdditional CSS class names applied to the root element.
data-testidstringTest ID applied to the root element.
descriptionReactNodeSupporting text rendered between the label and control.
descriptionIDstringID for the description element.
inputId*stringID of the associated control.
isDisabledbooleanfalseWhether the associated control is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label and description.
label*stringField label text.
labelAs'label' | 'span''label'HTML element used for the label. Use 'span' for group controls (e.g., radiogroup) where htmlFor cannot target a labelable element.
labelIconIconComponentOptional icon shown before the label.
labelIdstringID applied to the label element, useful for aria-labelledby.
labelTooltipReactNodeTooltip content shown next to the label.
refRef<HTMLDivElement>Ref forwarded to the root element.
statusFieldStatusValidation status displayed below the control.
statusVariant"attached" | "detached"'attached'How the status message is positioned.
styleCSSPropertiesInline styles applied to the root element.
isOptional*true
isRequiredfalse

When isOptional: false, isRequired: true

PropTypeDefaultDescription
children*ReactNodeThe form control rendered inside the field.
classNamestringAdditional CSS class names applied to the root element.
data-testidstringTest ID applied to the root element.
descriptionReactNodeSupporting text rendered between the label and control.
descriptionIDstringID for the description element.
inputId*stringID of the associated control.
isDisabledbooleanfalseWhether the associated control is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label and description.
label*stringField label text.
labelAs'label' | 'span''label'HTML element used for the label. Use 'span' for group controls (e.g., radiogroup) where htmlFor cannot target a labelable element.
labelIconIconComponentOptional icon shown before the label.
labelIdstringID applied to the label element, useful for aria-labelledby.
labelTooltipReactNodeTooltip content shown next to the label.
refRef<HTMLDivElement>Ref forwarded to the root element.
statusFieldStatusValidation status displayed below the control.
statusVariant"attached" | "detached"'attached'How the status message is positioned.
styleCSSPropertiesInline styles applied to the root element.
isOptionalfalse
isRequired*true