<!-- generated by scripts/gen-docs.mjs from docs/system/field.md. Edit the source and rerun. -->
# Field

## Description
Names a control and ties its description and error to it.

`import { Field, FieldLabel, FieldControl, FieldDescription, FieldError } from "@/components/cobalt/ui/field"`, source `registry/cobalt/ui/field.tsx`, status `ready-with-gaps`.
`import { Label } from "@/components/cobalt/ui/label"`, source `registry/cobalt/ui/label.tsx`, status `ready-with-gaps`.
Foundation: `Base UI Field`, with Label on `shadcn label (base-luma, base)`. Traps checked: `trap/field-label`, `trap/label-unbound`, `trap/field-error-link`, `trap/field-error-timing`, `trap/field-keeps-input`, `trap/field-form-enter`, `trap/field-input-type`, `trap/required-everywhere`, `trap/control-height`, `trap/focus-ring-shape`, `trap/hover-beats-focus`, `trap/disabled-still-hovers`, `trap/touch-input-zoom`, `trap/touch-autofocus`.

Where each trap is answered: `trap/field-label` and `trap/label-unbound` in `rule/field-control-wires-itself` and `rule/label-binds-its-control`, Base UI gives the label's `htmlFor` the id of whichever control registers inside the Field, and a plain Label binds by `htmlFor` or by wrapping its control; `trap/field-error-link` in States, `aria-describedby` lists the description and the shown error, and `aria-invalid` follows the shown error; `trap/field-error-timing` in `rule/field-error-when-settled`; `trap/field-keeps-input` through `rule/input-keeps-the-value-on-failure`; `trap/field-form-enter` through `rule/input-in-a-form`; `trap/field-input-type` through `rule/input-type-for-the-keyboard`; `trap/required-everywhere` in `rule/label-marks-the-rarer`; `trap/disabled-still-hovers` in States, a disabled label takes no pointer events through its group. Not applicable: `trap/control-height`, `trap/focus-ring-shape`, `trap/hover-beats-focus`, `trap/touch-input-zoom` and `trap/touch-autofocus` belong to the control inside, answered on Input, Textarea and Select; a label is text, never focused, and changes nothing under the pointer but the `row` fill.

### Foundation
| Given by the foundation | Added by the team |
|---|---|
| Base UI's `Field.Root`, `Field.Label`, `Field.Description`, `Field.Error`, `Field.Control` and `Field.Item`: one labelable scope per field, the label's `for` pointed at the control that registers in it, `aria-describedby` built from the mounted description and error ids, `aria-invalid` and `data-invalid` from `invalid`, `disabled` passed to the control and `data-disabled` on every part. Base UI's Input, Select, Combobox, Checkbox, Switch and RadioGroup register on their own | Label's look on `FieldLabel` (`render={<Label />}`); Textarea drawn as `Field.Control` so it registers like Input; `invalid` following the `FieldError`s the Field shows, counted in a layout effect before the first paint; a `FieldError` with children shown while it is rendered (`match` true), and Base UI's own validity messages when it is given `match`; each RadioGroupItem in a Field wrapped in `Field.Item`, so its radio keeps an id of its own; `FieldControl` kept for a control that does not register, such as DatePicker. The description and the error break a long address (`overflow-wrap: break-word`), so an email with no hyphen in an error never runs out of the column (`docs/research/2026-10-16-break-ui-inputs.md`). |
| Label: a native `<label>` from shadcn, `text-sm font-medium`, a flex row with `gap-2` so a control can sit inside it, `select-none`, and the disabled hooks `peer-disabled:opacity-50 cursor-not-allowed` | The disabled hooks read Base UI's attributes, `group-data-disabled/field` and `peer-data-disabled` beside native `peer-disabled`, and a wrapped checkbox or switch that is disabled fades the whole row once (`has-[>[data-slot=checkbox][data-disabled]]:opacity-50`), the control not fading again; `leading-snug` in place of `leading-none`, so a label that wraps, in German at 320px for one, keeps a gap between its lines and room for stacked diacritics; `items-start`, with a checkbox or a switch moved down to the middle of the first line (`calc((1lh - its height) / 2)`), so a control beside a wrapped label sits on its first line; the `row` variant, 38px from `py-2.25` around one line (`docs/research/2026-10-16-break-ui-inputs.md`). |

## Examples
An email field with a description, checked when you leave it.

Real uses, 0 call sites (`rg -n "<Field\b" app docs/system/examples --glob '!docs/system/examples/field/*'`): the showcase chrome renders no Field of its own, the examples folder does not count, and the registry folder never counts.

Uses inside the examples folder, which stand in for product screens until the first one lands on the system:
- An Input inside a Field with a description, `docs/system/examples/input/in-field.tsx:7`.
- A Textarea inside a Field with the limit in the description, `docs/system/examples/textarea/in-field.tsx:12`.
- A Select inside a Field with a description, `docs/system/examples/select/in-field.tsx:14`.
- A plain Label wrapping a Checkbox or a Switch with its words in 17 places, such as `docs/system/examples/checkbox/default.tsx:30-33` and `docs/system/examples/switch/default.tsx:29-31`.

Uses inside the registry, which other components build on:
- `FieldLabel`, Base UI's `Field.Label` rendered as a Label, with the Field's `htmlFor`, `registry/cobalt/ui/field.tsx:55-57`.

### Example files
| File | Covers | Caption |
|---|---|---|
| `docs/system/examples/field/default.tsx` | default | An email field with a description, checked when you leave it |
| `docs/system/examples/field/default.tsx` | variant=default | The name above the control, in the ink |
| `docs/system/examples/field/variant-row.tsx` | variant=row | Each row is the whole target for its checkbox |
| Not applicable: the field in default.tsx has a description | state:described | The description under the control, tied by aria-describedby |
| `docs/system/examples/field/state-invalid.tsx` | state:invalid | After a check, the error under the control and the red wash on it |
| `docs/system/examples/field/state-disabled.tsx` | state:disabled | Disabling the Field disables its control and fades its label |
| Not applicable: reached with the pointer over any label on this page | state:hover | Nothing on a default label; the row fill on a `row` label |
| `docs/system/examples/field/in-form.tsx` | composition:Form | Two fields and one submit, so Enter submits the form |
| `docs/system/examples/field/other-controls.tsx` | composition:Select | A Select, a Checkbox and a Switch take their name and description from the Field, with no ids |
| `docs/system/examples/field/side-by-side.tsx` | composition:Input | Two names in one row get a Field each, so each control has its own label |
| `docs/system/examples/field/label.tsx` | composition:Checkbox | A plain Label wraps a checkbox that needs no description, below a field named by its FieldLabel |

Example: An email field with a description, checked when you leave it (`docs/system/examples/field/default.tsx`)

```tsx
import { useState } from "react";

import { Field, FieldDescription, FieldError, FieldLabel } from "@/components/cobalt/ui/field";
import { Input } from "@/components/cobalt/ui/input";

const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;

export default function Example() {
  const [email, setEmail] = useState("");
  // Checked when the field loses focus; once shown, the error leaves as soon as the address is whole.
  const [error, setError] = useState(false);
  return (
    <Field className="max-w-sm">
      <FieldLabel>Email</FieldLabel>
      <Input
        type="email"
        autoComplete="email"
        placeholder="ada@example.com"
        value={email}
        onChange={(event) => {
          setEmail(event.target.value);
          if (EMAIL.test(event.target.value.trim())) setError(false);
        }}
        onBlur={() => setError(email.trim() !== "" && !EMAIL.test(email.trim()))}
      />
      <FieldDescription>Where we send the receipt.</FieldDescription>
      <FieldError reserve>{error ? "Enter an address with a domain, such as ada@example.com." : ""}</FieldError>
    </Field>
  );
}
```

Example: Two fields and one submit, so Enter submits the form (`docs/system/examples/field/in-form.tsx`)

```tsx
import { useState, type ChangeEvent } from "react";

import { Field, FieldDescription, FieldError, FieldLabel } from "@/components/cobalt/ui/field";
import { Input } from "@/components/cobalt/ui/input";
import { StateButton } from "@/components/cobalt/ui/state-button";
import { useAction } from "@/lib/cobalt/use-action";

// Stands in for your API call. It answers after 900ms, and fails while the browser is offline or the
// address has ?network=offline.
const request = () =>
  new Promise<void>((resolve, reject) =>
    setTimeout(() => {
      const offline = !navigator.onLine || new URLSearchParams(location.search).get("network") === "offline";
      if (offline) reject(new Error("offline"));
      else resolve();
    }, 900),
  );

const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;

function problems(values: { name: string; email: string }) {
  return {
    name: values.name.trim() === "" ? "Enter the name to put on the invitation." : "",
    email:
      values.email.trim() === ""
        ? "Enter the address to send the invitation to."
        : EMAIL.test(values.email.trim())
          ? ""
          : "Enter an address such as ada@example.com.",
  };
}

export default function Example() {
  const [values, setValues] = useState({ name: "", email: "" });
  // Fields are checked on the first submit, then again on every change until they are right.
  const [submitted, setSubmitted] = useState(false);
  const [sentTo, setSentTo] = useState("");
  const send = useAction(async (email: string) => {
    await request();
    return email;
  });
  const errors = submitted ? problems(values) : { name: "", email: "" };
  const edit = (key: "name" | "email") => (event: ChangeEvent<HTMLInputElement>) => {
    setValues((was) => ({ ...was, [key]: event.target.value }));
  };
  return (
    <form
      noValidate
      className="flex max-w-sm flex-col gap-3"
      onSubmit={(event) => {
        event.preventDefault();
        setSubmitted(true);
        const found = problems(values);
        const first = found.name !== "" ? "name" : found.email !== "" ? "email" : null;
        if (first !== null) {
          const field = event.currentTarget.elements.namedItem(first);
          if (field instanceof HTMLInputElement) field.focus();
          return;
        }
        setSentTo("");
        void send.run(values.email.trim()).then((email) => {
          if (email !== undefined) setSentTo(email);
        });
      }}
    >
      <Field>
        <FieldLabel>Name</FieldLabel>
        <Input name="name" autoComplete="name" value={values.name} onChange={edit("name")} />
        <FieldError reserve>{errors.name}</FieldError>
      </Field>
      <Field>
        <FieldLabel>Email</FieldLabel>
        <Input
          name="email"
          type="email"
          autoComplete="email"
          value={values.email}
          onChange={edit("email")}
        />
        <FieldDescription>Where we send the invitation.</FieldDescription>
        <FieldError reserve>{errors.email}</FieldError>
      </Field>
      <div className="flex items-center gap-3">
        <StateButton
          type="submit"
          status={send.status}
          pendingLabel="Sending"
          successLabel="Sent"
          failureLabel="Not sent"
        >
          Send invitation
        </StateButton>
        {/* The line is always there, so the result moves nothing when it appears. */}
        <p
          role="status"
          className={
            send.error !== null
              ? "min-w-0 text-sm text-destructive"
              : "min-w-0 truncate text-sm text-muted-foreground"
          }
        >
          {send.error !== null
            ? "The invitation was not sent. Check your connection and try again."
            : sentTo === ""
              ? ""
              : `Sent to ${sentTo}`}
        </p>
      </div>
    </form>
  );
}
```

Example: A Select, a Checkbox and a Switch take their name and description from the Field, with no ids (`docs/system/examples/field/other-controls.tsx`)

```tsx
import { useState } from "react";

import { Checkbox } from "@/components/cobalt/ui/checkbox";
import { Field, FieldDescription, FieldLabel } from "@/components/cobalt/ui/field";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/cobalt/ui/select";
import { Switch } from "@/components/cobalt/ui/switch";

const zones = [
  { value: "Europe/Lisbon", label: "Lisbon" },
  { value: "Europe/Oslo", label: "Oslo" },
  { value: "Asia/Tokyo", label: "Tokyo" },
];

export default function Example() {
  const [zone, setZone] = useState<string | null>("Europe/Oslo");
  return (
    <div className="flex max-w-sm flex-col gap-6">
      <Field>
        <FieldLabel>Time zone</FieldLabel>
        <Select items={zones} value={zone} onValueChange={setZone}>
          <SelectTrigger className="w-full">
            <SelectValue />
          </SelectTrigger>
          <SelectContent>
            {zones.map((option) => (
              <SelectItem key={option.value} value={option.value}>
                {option.label}
              </SelectItem>
            ))}
          </SelectContent>
        </Select>
        <FieldDescription>Booking times show in this zone.</FieldDescription>
      </Field>
      <Field>
        <FieldLabel>
          <Checkbox defaultChecked />
          Send me a copy of each booking
        </FieldLabel>
        <FieldDescription>Copies go to ana.lima@example.com.</FieldDescription>
      </Field>
      <Field>
        <FieldLabel>
          <Switch />
          Compact rows
        </FieldLabel>
        <FieldDescription>Kept on this device only.</FieldDescription>
      </Field>
    </div>
  );
}
```

Example: Two names in one row get a Field each, so each control has its own label (`docs/system/examples/field/side-by-side.tsx`)

```tsx
import { Field, FieldLabel } from "@/components/cobalt/ui/field";
import { Input } from "@/components/cobalt/ui/input";

export default function Example() {
  return (
    <div className="grid max-w-sm grid-cols-2 gap-3">
      <Field>
        <FieldLabel>Given name</FieldLabel>
        <Input autoComplete="given-name" defaultValue="Ana" />
      </Field>
      <Field>
        <FieldLabel>Family name</FieldLabel>
        <Input autoComplete="family-name" defaultValue="Lima" />
      </Field>
    </div>
  );
}
```

Example: A plain Label wraps a checkbox that needs no description, below a field named by its FieldLabel (`docs/system/examples/field/label.tsx`)

```tsx
import { Checkbox } from "@/components/cobalt/ui/checkbox";
import { Field, FieldLabel } from "@/components/cobalt/ui/field";
import { Input } from "@/components/cobalt/ui/input";
import { Label } from "@/components/cobalt/ui/label";

export default function Example() {
  return (
    <div className="flex max-w-sm flex-col gap-4">
      <Field>
        <FieldLabel>Guest email</FieldLabel>
        <Input type="email" autoComplete="off" placeholder="ada@example.com" />
      </Field>
      <Label>
        <Checkbox />
        Send me a copy of the invitation
      </Label>
    </div>
  );
}
```

## Variants
The Field's two booleans, `invalid` and `disabled`, are states. The one axis is the label's look, on Label and on FieldLabel.

### variant
- `default`: the name above a text field or beside a toggle, `text-sm font-medium`.
- `row`: a full-width row the height of a menu row, with a hover fill and regular weight, so the whole row is the target, for a list of checkboxes or switches in a settings list, a sheet or a popover.

Example: The name above the control, in the ink (`docs/system/examples/field/default.tsx`)

```tsx
import { useState } from "react";

import { Field, FieldDescription, FieldError, FieldLabel } from "@/components/cobalt/ui/field";
import { Input } from "@/components/cobalt/ui/input";

const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;

export default function Example() {
  const [email, setEmail] = useState("");
  // Checked when the field loses focus; once shown, the error leaves as soon as the address is whole.
  const [error, setError] = useState(false);
  return (
    <Field className="max-w-sm">
      <FieldLabel>Email</FieldLabel>
      <Input
        type="email"
        autoComplete="email"
        placeholder="ada@example.com"
        value={email}
        onChange={(event) => {
          setEmail(event.target.value);
          if (EMAIL.test(event.target.value.trim())) setError(false);
        }}
        onBlur={() => setError(email.trim() !== "" && !EMAIL.test(email.trim()))}
      />
      <FieldDescription>Where we send the receipt.</FieldDescription>
      <FieldError reserve>{error ? "Enter an address with a domain, such as ada@example.com." : ""}</FieldError>
    </Field>
  );
}
```

Example: Each row is the whole target for its checkbox (`docs/system/examples/field/variant-row.tsx`)

```tsx
import { Checkbox } from "@/components/cobalt/ui/checkbox";
import { Label } from "@/components/cobalt/ui/label";

const channels = ["Email", "Push notifications", "Text messages"];

export default function Example() {
  return (
    <div className="flex w-full max-w-xs flex-col gap-px px-3">
      {channels.map((channel, i) => (
        <Label key={channel} variant="row">
          <Checkbox defaultChecked={i === 0} />
          {channel}
        </Label>
      ))}
    </div>
  );
}
```

## States
| State | Trigger | What the user can do | Shown by, besides color | Checked by |
|---|---|---|---|---|
| default | a `FieldLabel` and a control | use the control; click the label to focus it, which shows the caret and not the ring, since the ring follows the Tab key (D40) | the label above the control, bound by `for` | test |
| described | a `FieldDescription` child | read the description before entering | the text under the control, in `aria-describedby`, read after the name | test |
| invalid | a shown `FieldError`, or `invalid` | fix the value | the error text under the control, linked by `aria-describedby`, `aria-invalid` on the control, `data-invalid` on the field; on an Input or Textarea the red wash always, and the red edge and ring after Tab (D40) | test |
| disabled | `disabled` on the Field, or a disabled control wrapped in a Label | nothing on the control; the words take no pointer | `disabled` on the control, `data-disabled` on the field, the label and the control at half opacity | test |
| hover | pointer over a label, under `(hover: hover)` | click or tap the words to reach the control | nothing on a default label, since the control's own look answers the click; a `row` label takes the `--hover` fill | by hand |

In a disabled Field the label fades with its control: the Field's group is `group/field` and the Label's hook listens to Base UI's `data-disabled` on that named group (measured opacity 0.5 on the label after the rebuild on Base UI, Playwright on the field page, 2026-10-17; before it, .design-system/evidence/field/after-fix-light-390.json). A Checkbox or Switch wrapped in a plain Label that is disabled fades the whole row to 0.5 once, and the control does not fade a second time (measured effective opacity 0.5 on the box). Pending is not a state of the field: the form's `StateButton` carries it (`rule/button-keeps-its-box-when-busy`). An Input or Textarea in a Field leaves password managers to fill it, except for `type="search"` and `autoComplete="off"`, and `focus()` from code after a click shows the caret and the wash, not the ring, because the ring follows the Tab key (D40).

Example: After a check, the error under the control and the red wash on it (`docs/system/examples/field/state-invalid.tsx`)

```tsx
import { useState } from "react";

import { Field, FieldError, FieldLabel } from "@/components/cobalt/ui/field";
import { Input } from "@/components/cobalt/ui/input";

const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;

export default function Example() {
  // As after a submit with this address; the error leaves as soon as the address is whole.
  const [email, setEmail] = useState("ada@example");
  const [error, setError] = useState(true);
  return (
    <Field className="max-w-sm">
      <FieldLabel>Email</FieldLabel>
      <Input
        type="email"
        autoComplete="email"
        value={email}
        onChange={(event) => {
          setEmail(event.target.value);
          if (EMAIL.test(event.target.value.trim())) setError(false);
        }}
        onBlur={() => setError(!EMAIL.test(email.trim()))}
      />
      <FieldError reserve>{error ? "Enter an address with a domain, such as ada@example.com." : ""}</FieldError>
    </Field>
  );
}
```

Example: Disabling the Field disables its control and fades its label (`docs/system/examples/field/state-disabled.tsx`)

```tsx
import { Field, FieldDescription, FieldLabel } from "@/components/cobalt/ui/field";
import { Input } from "@/components/cobalt/ui/input";

export default function Example() {
  return (
    <Field disabled className="max-w-sm">
      <FieldLabel>Workspace</FieldLabel>
      <Input defaultValue="Oslo office" />
      <FieldDescription>Set when the workspace was created.</FieldDescription>
    </Field>
  );
}
```

### State precedence
- Disabled and invalid: disabled wins. The host drops the `FieldError` while the field is disabled, so no error reads on a value the user cannot fix; the component itself keeps both attributes when both are passed.
- `invalid` and a shown `FieldError`: the prop wins. `invalid={false}` with an error child keeps the text visible and the control valid, for a value fixed and saving; `invalid` with no child marks the control with no text.
- Described and invalid: both show. The description then the error, in that order in `aria-describedby`.
- Described and disabled: both show. The description stays readable at full opacity.
- Disabled and hover: disabled wins. Pointer events are off through the group, so nothing happens under the pointer or on a click.

### Motion
| Trigger | Kind | Preset | Properties | Reduced motion |
|---|---|---|---|---|
| pointer over a `row` label | input | `--t-press` with `--curve` | background colour to `--hover` | Not applicable: a colour change only |
| a reserved `FieldError` meets a message longer than its room, such as a first error that wraps to a second line | announce | Grow: `--t-layout` on `--curve-layout`, through `useFollowHeight` from `registry/cobalt/lib/follow-height.ts` | height of the error line's box, whose overflow is clipped while it moves | none: the room takes its new height at once |

## Props

<!-- Props generated from registry/cobalt/ui/field.tsx, registry/cobalt/ui/label.tsx with TypeScript by scripts/props-table.mjs -->
### Field

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `className?` | `string` |  |  |

Also accepts every native `<div>` attribute; from Base UI: `actionsRef`, `dirty`, `disabled`, `invalid`, `name`, `render`, `touched`, `validate`, `validationDebounceTime`, `validationMode`.

### FieldLabel

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `className?` | `string` |  |  |
| `variant?` | `"default" \| "row"` |  | `default` the name above a text field or beside a toggle; `row` a full-width row the height of a menu row. |

Also accepts every native `<label>` attribute; from Base UI: `nativeLabel`, `render`.

### FieldControl

No props of its own.

Also accepts every native `<input>` attribute; from Base UI: `defaultValue`, `onValueChange`, `render`.

### FieldDescription

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `className?` | `string` |  |  |

Also accepts every native `<p>` attribute; from Base UI: `render`.

### FieldError

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `className?` | `string` |  |  |
| `reserve?` | `boolean` | `false` |  |

Also accepts every native `<div>` attribute; from Base UI: `match`, `render`.

### Label

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `variant?` | `"default" \| "row"` | `"default"` | `default` the name above a text field or beside a toggle; `row` a full-width row the height of a menu row. |

Also accepts every native `<label>` attribute.

`Field` is Base UI's `Field.Root`: `invalid` (follows the shown `FieldError` when unset), `disabled` (false), `name`, `validate`, `validationMode`, and every `div` attribute. `FieldLabel` takes Label's props and `variant`; the field sets `htmlFor`. `Label` takes every native label attribute, `htmlFor`, `id` and `aria-*`, and `variant`; its children are the name and may hold the control itself. `FieldControl` is Base UI's `Field.Control`, for a control that does not register itself, such as `<FieldControl render={<DatePicker />} />`: it merges the field's `id`, `aria-labelledby`, `aria-describedby`, `aria-invalid` and `disabled` into the element in `render`. Input, Textarea, Select, Combobox, Checkbox, Switch and RadioGroup need no wrapper; one wrapped in `FieldControl` still works. `FieldDescription` takes `p` attributes. `FieldError` takes `div` attributes, `match` and `reserve`: with children and no `match` it shows while it has a message, and an empty string, `false` or `null` shows nothing; with `match` it is Base UI's, shown for that failed constraint with the browser's message unless it has children. `reserve` keeps the error's room while there is no message, one line before the first error and the last error's height after it goes, so an error that comes on submit or goes as the value is fixed moves nothing below it; render it always and pass the message or an empty string. A message longer than that room, which cannot be known before it comes, grows the room to it over the system's Grow instead of jumping, and what is below moves with it once; a shorter message that follows shrinks it the same way. Measured on field/default.tsx: at 390, where "Enter an address with a domain, such as ada@example.com." takes two lines, the room grew from 16 to 32px over about 420ms and the next heading moved with it frame by frame, never more than 2px a frame, and fixing the address moved nothing; at 1440, where it fits one line, nothing moved. `className` on each part is merged last and is for placement, such as `max-w-sm` on the field.

## Usage

### When to use
- A control has a visible name, and a description or an error now or later: a Field.
- A form has more than one field, so each one's wiring must not drift from the others: a Field each.
- A checkbox or a switch with only its words, such as a filter or a setting row: a plain Label around the control.

### When not to use
- The words introduce several controls, such as a group of switches. Use a `fieldset` with a `legend` instead, with a Label per control (`rule/label-only-for-a-control`).
- The words are a caption, a key in a key-value row or a heading. Use Section instead, or plain text.
- The fields need to submit together. Use a `form` around the Fields with one submit Button instead of a Field around the form.

### Rules
- Follows `rule/input-in-a-form`.
- Follows `rule/input-keeps-the-value-on-failure`.
- `rule/field-control-wires-itself`: When a control sits in a Field, put the Cobalt control in it bare, such as `<Input />`, `<Textarea />` or a Select, and wrap only a control that does not register, such as DatePicker, in `FieldControl`, instead of giving it an `id` or `aria-describedby` by hand, because Base UI hands the registered control the label's id, the description and the error, and a hand-written id breaks that link. Evidence: person D34; app 49/56 Fields in the examples hold a bare control and 7/56 a DatePicker through `FieldControl` (`rg -n "<FieldControl\b" docs/system/examples`); measured on 17 showcase pages, every FieldLabel's `for` resolves to its control and every shown error is in the control's `aria-describedby` (Playwright, 2026-10-17); principle wcag: 1.3.1 Info and relationships. Check: test `field.test.tsx` "a bare control is named by the label, with no FieldControl around it"; review.
  - Don't: `<Field><FieldLabel htmlFor="email">Email</FieldLabel><Input id="email" aria-describedby="email-error" /></Field>`
  - Do: `<Field><FieldLabel>Email</FieldLabel><Input type="email" /></Field>`
- `rule/field-error-when-settled`: When the user is still typing, hold the `FieldError` until the field loses focus or the form submits, instead of rendering it on the first keystroke, because an error on an unfinished value is wrong by definition, and it turns the control red under the person's fingers. Evidence: principle heuristic: error prevention, the check runs when the entry is complete; principle wcag: 3.3.1 Error identification, the error describes a value the user has given. Check: review of every handler that sets a field's error.
  - Don't: `<Field>{!isEmail(value) && <FieldError>Enter an address with a domain.</FieldError>}</Field>` with `value` set on every change
  - Do: `<Field>{touched && error && <FieldError>{error}</FieldError>}</Field>` with `touched` set on blur or submit
- `rule/field-focus-first-error`: When a submit stops on an invalid field, call `focus()` on the first invalid control in the form's order and show its `FieldError`, instead of leaving focus on the submit button, because a screen reader then hears the field's name and its error at once, a keyboard user is where the fix is, and on a phone the field scrolls into view. Evidence: principle wcag: 3.3.1 Error identification, the item in error is identified; principle platform: the GOV.UK error summary pattern moves focus to the error on submit; app 3/3 forms in the examples that check on submit move focus to the field, `docs/system/examples/dialog/default.tsx:79`, `docs/system/examples/field/in-form.tsx:58`, `docs/system/examples/blocks/alert-rules.tsx:256`; measured focus left on the submit button in the settings scene before its fix, `docs/research/2026-10-16-first-principles.md` defect 3. Check: review of every submit handler's invalid branch; probe: submit the form empty with the keyboard and read `document.activeElement`, which is the first invalid control.
  - Don't: `onSubmit={(event) => { event.preventDefault(); setSubmitted(true); if (!valid) return; save(); }}`
  - Do: `onSubmit={(event) => { event.preventDefault(); setSubmitted(true); const first = invalid[0]; if (first) { inputs.current[first]?.focus(); return; } save(); }}`
- `rule/field-one-control`: When a Field or a bound Label renders, it names exactly 1 control, and a pair such as a date and a time gets 2 Fields side by side, because the label's `for`, the description and the error point at one `id`, and a screen reader reads one name per control. Evidence: principle wcag: 1.3.1 Info and relationships, one name and one description per control; app 11/11 Fields on this page hold one control (`docs/system/examples/field/side-by-side.tsx:9-12`), and 17/17 Label uses in the examples name one control. Check: review; a second control in one Field takes the same `id`, so the label names only one of them; lint trap/label-unbound (scripts/check-system.mjs) for a Label bound to nothing.
  - Don't: `<Field><FieldLabel>When</FieldLabel><Input type="date" /><Input type="time" /></Field>`
  - Do: `<Field><FieldLabel>Date</FieldLabel><Input type="date" /></Field> <Field><FieldLabel>Time</FieldLabel><Input type="time" /></Field>`
- `rule/field-disabled-through-the-field`: When a labelled control is disabled, set `disabled` on the `Field` instead of on the control alone, because the Field then passes `disabled` to the control and marks itself `data-disabled` for the host to dim the parts around it. Evidence: app 2/2 disabled Fields on this page and Input's set it on the Field (`docs/system/examples/field/state-disabled.tsx:7`, `docs/system/examples/input/state-disabled.tsx:7`), and the prop exists for every Field; principle platform: a disabled control and the words around it read as one disabled unit. Check: test `field.test.tsx` "disabled reaches the control and marks the field".
  - Don't: `<Field><FieldLabel>Workspace</FieldLabel><Input disabled /></Field>`
  - Do: `<Field disabled><FieldLabel>Workspace</FieldLabel><Input /></Field>`
- `rule/label-binds-its-control`: When a Label names a control, bind it with `htmlFor` to the control's `id`, or render the control inside the Label, or use `FieldLabel` inside a `Field`, instead of a free label above the box, because an unbound label gives the control no name and a click on the words does nothing. Evidence: app 17/17 Label uses in the examples bind, all by wrapping a Checkbox or Switch (`rg -n "<Label\b" docs/system/examples`); principle wcag: 1.3.1 Info and relationships, the name is in the markup; principle platform: a bound label is part of the control's hit area. Check: lint trap/label-unbound (scripts/check-system.mjs); test `label.test.tsx` "is a native label bound by htmlFor".
  - Don't: `<Label>Email</Label> <Input type="email" />`
  - Do: `<Field><FieldLabel>Email</FieldLabel><Input type="email" /></Field>`
- `rule/label-above-text-beside-toggle`: When the control is a text field, a textarea or a select, put the label above it, as Field draws it; when it is a Checkbox or a Switch, render the control inside the `Label` or `FieldLabel` on one row, because a text field reads top to bottom and a toggle reads as one phrase with its words. Evidence: app 17/17 plain toggle labels in the examples wrap their control (`docs/system/examples/checkbox/default.tsx:30-33`, `docs/system/examples/switch/default.tsx:29-31`, `docs/system/examples/sheet/default.tsx:45-46`), and every Field stacks its label above its control, a text field included (`docs/system/examples/textarea/default.tsx:8-9`). Check: review of every new form row.
  - Don't: `<div className="flex items-center gap-2"><Label htmlFor="name">Name</Label><Input id="name" /></div>`
  - Do: `<Field><FieldLabel>Name</FieldLabel><Input /></Field>`

### Content
- Follows `rule/writing-field-label-noun`.
- Follows `rule/writing-placeholder-not-label`.
- `rule/field-error-names-the-fix`: When a `FieldError` renders, it says what to enter, with an example where one exists, such as "Enter an address with a domain, such as ada@example.com.", instead of "Invalid email" or "Required", because the user reads it to fix the value, and the field's name is already in the label. Evidence: app 12/12 written FieldError texts in the examples say what to do (`docs/system/examples/field/default.tsx:28`, `docs/system/examples/input/state-invalid.tsx:27`, `docs/system/examples/select/state-invalid.tsx:31`); principle wcag: 3.3.3 Error suggestion. Check: review of every FieldError string.
  - Don't: `<FieldError>Invalid email</FieldError>`
  - Do: `<FieldError>Enter an address with a domain, such as ada@example.com.</FieldError>`
- `rule/field-description-is-one-sentence`: When a `FieldDescription` renders, it is 1 sentence with a full stop saying what the value is for or where it goes, such as "Where we send the receipt.", instead of repeating the label or the placeholder, because it is read after the name on every focus and a repeat costs the listener time for nothing. Evidence: app 9/9 descriptions on the Field and Input pages are one sentence (`docs/system/examples/field/default.tsx:27`, `docs/system/examples/field/in-form.tsx:81`, `docs/system/examples/field/state-disabled.tsx:10`, `docs/system/examples/field/other-controls.tsx:34`, `docs/system/examples/input/in-field.tsx:10`). Check: review of every FieldDescription string.
  - Don't: `<FieldLabel>Email</FieldLabel> <FieldDescription>Your email address</FieldDescription>`
  - Do: `<FieldLabel>Email</FieldLabel> <FieldDescription>Where we send the receipt.</FieldDescription>`
- `rule/label-marks-the-rarer`: When a form has required and optional fields, mark the rarer kind in the label, "Phone (optional)" or "Email (required)", instead of a marker on every field, because a marker on every field carries no information. Evidence: principle heuristic: recognition rather than recall, the marker stands out only when it is rare; principle wcag: 3.3.2 Labels or instructions, the requirement is stated in the label. Check: review of every form with more than 2 fields.
  - Don't: `<FieldLabel>Name *</FieldLabel> <FieldLabel>Email *</FieldLabel> <FieldLabel>Phone *</FieldLabel>`
  - Do: `<FieldLabel>Name</FieldLabel> <FieldLabel>Email</FieldLabel> <FieldLabel>Phone (optional)</FieldLabel>`

### Anti-slop
- `rule/field-over-handwritten-ids`: When a form field needs a label, a description or an error, use `Field` with its parts instead of a `Label` with `htmlFor`, an `Input` with `id` and a `p` with `id` wired by hand, because hand-written ids collide when the form renders twice on a page and the `aria-describedby` link is the part agents leave out. Evidence: person D34; app 5/5 Textarea examples name their field through a Field (`docs/system/examples/textarea/default.tsx:7-8`, `docs/system/examples/textarea/state-invalid.tsx:14-15`, `docs/system/examples/textarea/state-disabled.tsx:7-8`), as every Input example does, and the one hand-wired label left in the examples names a list row (`docs/system/examples/blocks/alert-rules.tsx:131`). Check: review of every new form.
  - Don't: `<Label htmlFor="email">Email</Label> <Input id="email" aria-describedby="email-hint" /> <p id="email-hint">Where we send the receipt.</p>`
  - Do: `<Field><FieldLabel>Email</FieldLabel><Input type="email" /><FieldDescription>Where we send the receipt.</FieldDescription></Field>`
- `rule/field-error-not-a-toast`: When a field's value fails a check, render a `FieldError` under that field instead of a toast or a banner above the form, because the toast leaves and the field stays wrong without saying so, and a screen reader hears the error at the field only through the link. Evidence: principle wcag: 3.3.1 Error identification, the item in error is identified; principle heuristic: help users recognize, diagnose and recover from errors, the message sits where the fix is. Check: review of every submit handler's failure branch.
  - Don't: `toast("Enter a valid email")`
  - Do: `<FieldError>Enter an address with a domain, such as ada@example.com.</FieldError>`
- `rule/label-only-for-a-control`: When words introduce a group of controls, caption a card or sit as the key in a key-value row, use a `fieldset` with a `legend`, a Section title or a `p` with `text-sm font-medium` instead of a `Label`, because a `label` bound to nothing names nothing, is `select-none`, and trips the unbound-label lint. Evidence: app 24/24 Label uses in the examples name one control, 0 are headings or captions; principle platform: `fieldset` and `legend` name a group. Check: lint trap/label-unbound (scripts/check-system.mjs).
  - Don't: `<Label>Notifications</Label> <Switch id="weekly" /> <Switch id="daily" />`
  - Do: `<fieldset><legend className="text-sm font-medium">Notifications</legend> <Label><Switch /> Weekly summary</Label> <Label><Switch /> Daily digest</Label></fieldset>`

### Limits
- `rule/label-length`: When a label would run past 44 characters at 390px, move the detail to `FieldDescription` instead, because the label wraps at 45 characters in a 310px column and a label longer than its column wraps to a second line that pushes the control down. Evidence: measured wrap at 45 characters, 14px lines, .design-system/evidence/label/grow-text-390.json. Check: probe .design-system/scripts/grow-inputs.mjs on the showcase at 390.
  - Don't: `<FieldLabel>Display name shown beside everything you post to the team</FieldLabel>`
  - Do: `<FieldLabel>Display name</FieldLabel> <FieldDescription>Shown beside everything you post.</FieldDescription>`

The placeholder and line limits live on Input and Textarea.

## Accessibility
Rests on the native `label` and the control inside, wired by Base UI's Field; the Field adds only ids and the links between them, and no live region: an error is read through the control's description. A label is never focused; its words become the control's name, and a click on them reaches the control.

### Keyboard
| Key | Where focus is | Effect | Focus after | Checked by |
|---|---|---|---|---|
| Tab | before the field | skips the label and lands on the control | the control | by hand |
| Tab | the control | leaves to the next control; the description and the error are never stops | the next control | by hand |
| Enter or Space | a control wrapped in a label | acts on the control, not the label | the control | by hand |

### ARIA
| Part | Role | Accessible name from | States and properties | Announced | Checked by |
|---|---|---|---|---|---|
| FieldLabel, Label | none, a `label` element | its text | `for` to the control's id, or the control as a child | as the control's name on focus; the label itself is skipped | a11y scan |
| the control | its own: textbox, combobox, checkbox, switch, radiogroup | the FieldLabel, by `for` or, for a checkbox, a switch or a radio group, `aria-labelledby` | `aria-describedby` to the description and the error, `aria-invalid` when invalid, `disabled` when disabled | the name, the role, the value, then the description and the error | a11y scan |
| FieldDescription | none, a `p` | its text | referenced by `aria-describedby` | after the name, on focus | a11y scan |
| FieldError | none, a `div` | its text | referenced by `aria-describedby`; rendered only while there is an error | once, after the name and the description, when focus reaches the control; a submit that stops moves focus there (`rule/field-focus-first-error`), so that is the announcement. No `role="alert"`, which read it a second time | test |

Contrast, measured on the showcase at 390px (.design-system/evidence/field/states-390.json): the description 5.6:1 light and 7.66:1 dark; the error 5.24:1 light and 6.85:1 dark, both 12px text on the page. The label is `--foreground` on the page, 18.47:1 light and 18.97:1 dark (.design-system/evidence/select/states-390.json); a disabled label at half opacity is exempt (WCAG 1.4.3).

## Tokens
| Part | State | Token |
|---|---|---|
| root | all | `gap-1.5`, measured 6px between the parts |
| FieldLabel, Label | all | `--foreground`, `text-sm`, `font-medium`, `leading-snug` |
| FieldLabel, Label | disabled | opacity 50 percent |
| Label, `row` | hover | `--hover`, `--r-xl`, `--t-press`, `--curve` |
| FieldDescription | all | `--muted-foreground`, `text-xs` |
| FieldError | invalid | `--destructive`, `text-xs` |

## Related
- Input, Textarea, Select: the controls a Field holds.
- Checkbox, Switch: the controls a Label wraps.
- Button: the form's submit, as StateButton while it saves.
- Alert: a message about the whole form or page, not one field.
- NumberField: a count or an amount with a minus and a plus inside the field.
- Composer: a message field that names itself and holds its own error.
- Toast: a result from somewhere else; an error you fix in a form stays on its Field.
- InlineEdit: a value edited where it is read, saved on Enter or when the field is left.
- InviteField: email addresses typed or pasted as chips, with a role, to invite people.
- PageProblem: a page that could not load, with the reason and a way to try again.
