Skip to content

Field

Free

Puts a label, a control, and one line of help or an error together. FieldSet groups several controls under one legend.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

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>
PropTypeDefaultDescription
classNamestring—
From Base UIField.RootBase UI docs
disabledbooleanfalseWhether the component should ignore user interaction. Takes precedence over the disabled prop on the <Field.Control> component.
namestring—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>
PropTypeDefaultDescription
classNamestring—
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
nativeLabelbooleantrueWhether 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>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

FieldError

<div>
PropTypeDefaultDescription
classNamestring—
From Base UIField.ErrorBase UI docs
matchboolean | 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>
PropTypeDefaultDescription
classNamestring—
From Base UIField.ItemBase UI docs
disabledbooleanfalseWhether 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>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

FieldLegend

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

FieldGroup

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

FieldContent

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

FieldTitle

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

FieldSeparator

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

FieldValidity

PropTypeDefaultDescription
From Base UIField.ValidityBase UI docs
childrenRequired—A function that accepts the field validity state as an argument. ``jsx <Field.Validity> {(validity) => { return <div>...</div> }} </Field.Validity> ``
  • Put every form control in a Field: it links the label, the control, the help, and the error for screen readers.
  • Write an error that names the fix, such as "Add a domain (.com)." While it shows, the help hides, so the form keeps its height.
  • Use FieldError with match (such as valueMissing) to show it for one check, or match={true} with the invalid prop of Field for an error you control.
  • Use FieldSet and FieldLegend for related fields or a group of options.
  • To name a control outside a form, with no help or error, use a Label.

Field is a Base UI Field.Root. FieldLabel renders a <label> for the control, and the control gets aria-describedby for FieldDescription and FieldError. A screen reader reads the name, then the help or the error.

While a FieldError shows, FieldDescription hides and renders no text. A screen reader reads the error alone, as the screen shows it.

Put "Optional" in FieldLabel as a muted span, so a screen reader reads it with the name. Wrap a Checkbox, Radio, or Switch in FieldLabel to make the full row the hit area. For a Select, use SelectLabel in place of FieldLabel: the trigger is a button, and a native <label> would pass its clicks to it.

FieldSet holds a group of fields or options, and FieldLegend names the group. In a disabled Field the label fades to 50%.

Error shows and hides
none · the error and the help text swap in one frame, so the field never changes height
  1. AddedField.
Open the release