Put the label, the control, the help, and the error in one Field, so they link for screen readers. With match, each FieldError shows for one check only.
The sample also uses Input. One command adds them with this item:
billing-email-field.tsx
Field
<div>| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||||||||||||||
From Base UIField.RootBase UI docs | |||||||||||||||||||||||||||||||||||||||||
| disabled | boolean | false | Whether the component should ignore user interaction. Takes precedence over the disabled prop on the <Field.Control> component. | ||||||||||||||||||||||||||||||||||||||
| name | string | — | Identifies the field when a form is submitted. Takes precedence over the name prop on the <Field.Control> component. | ||||||||||||||||||||||||||||||||||||||
| validate | — | A function for custom validation. Return a string or an array of strings with the error message(s) if the value is invalid. Returning nothing, null, an empty string, or an empty array means the value is valid. Asynchronous functions are supported, but they do not prevent form submission when using validationMode="onSubmit". | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | ||||||||||||||||||||||||||||||||||||||
FieldLabel
<label>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| size | "default""sm" | "default" | default (14/20, weight 500) or sm, the meta look (12/16, weight 400, muted), as Label. |
From Base UIField.LabelBase UI docs | |||
| native | boolean | true | Whether the component renders a native <label> element when replacing it via the render prop. Set to false if the rendered element is not a label (for example, <div>). This is useful to avoid inheriting label behaviors on <button> controls (such as <Select.Trigger> and <Combobox.Trigger>), including avoiding :hover on the button when hovering the label, and preventing clicks on the label from firing on the button. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <label> attributes | — | Every other attribute goes to the <label>, with a ref. |
FieldDescription
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FieldError
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UIField.ErrorBase UI docs | |||
| match | boolean | keyof ValidityState | — | Determines whether to show the error message according to the field's ValidityState. Specifying true will always show the error message, and lets external libraries control the visibility. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FieldItem
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UIField.ItemBase UI docs | |||
| disabled | boolean | false | Whether the wrapped control should ignore user interaction. The disabled prop on <Field.Root> takes precedence over this. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FieldSet
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FieldLegend
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FieldGroup
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FieldContent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FieldTitle
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FieldSeparator
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
FieldValidity
| Prop | Type | Default | Description |
|---|---|---|---|
From Base UIField.ValidityBase UI docs | |||
| children | — | A function that accepts the field validity state as an argument. ``jsx <Field.Validity> {(validity) => { return <div>...</div> }} </Field.Validity> `` | |





