# Field: the label, hint and message of every input

Field wraps every input, select and picker in an app built on Meadowstack: a visible label above it, a short hint under it, and an error message that says what to do. It wires the label, the hint and the error to the control for screen readers, so no form uses a placeholder as its label or shows an error only as a red border.

Checked 2 December 2026. By Bohuslav Poláček. https://meadowstack.com/components/field/

*Juniper's lunch menu after Save with the third main left empty, and the starter's new purchase request without a supplier, rendered from the kit. The chosen day and dishes are written into their selects here; in the app the select fills in its own text.*

A live screen, rendered from the kit's components on the page: https://meadowstack.com/components/field/

## What it is for, and what the preview shows

Field is the frame of one control: its label, the control, a hint under it and the error when there is one. It takes exactly one child, such as an `Input`, `Select`, `NumberField`, `DatePicker`, `Textarea` or `Composer`, and gives it an id, `aria-describedby` pointing at the hint and the error, `aria-invalid` while there is an error, and `aria-required` when the field is required.

The preview shows two forms. The lunch menu of [Juniper](https://meadowstack.com/examples/restaurant-staff-rota/), a restaurant in the demo, after Save with the third main left empty: the dish and its price each say what to do ("Choose a dish.", "Enter the dish's price."), and the soup's hint lists its allergens. Beside it, the starter's new purchase request with the supplier missing, a hint under the amount and a date picker. Every field there is required, so none carries an asterisk.

## The rules, and where each one lives

- **Every input sits in a Field with a visible label.** The root `AGENTS.md` (Accessibility, WCAG 2.2 AA). An own `<input>`, `<select>` or `<textarea>` in an app fails `npm run check:markup` (`bare-control`).
- **Messages say what to do.** "Choose a dish.", not "Invalid value" (`AGENTS.md`, Forms and Copy). The messages live in the zod schema, and react-hook-form hands them to Field's `error`.
- **Required or optional, whichever is rarer.** The asterisk marks required fields by default; a form where nearly everything is required marks the optional ones instead, with `requiredMark={false}` on the required fields and `optional` on the rest (GOV.UK's rule, in the kit's `FieldProps`).
- **Readable in every state.** Labels, hints and placeholders at 12 and 13px are `text-fg` or `text-fg-muted`, never the lighter grey, in both themes (`AGENTS.md`, Accessibility; decision 0015).
- **Kit sizes.** Controls are 32px tall, 28 when small, 40 on touch screens; an `h-*` class on a kit control fails the static audit (`control-height`).
- **Unsaved changes are kept.** A form with unsaved changes blocks navigation and asks first (`AGENTS.md`, Forms: `useBlocker` with `useConfirm`).

## What AI coding tools write instead

The manifest's `replaces`: a hand-written `<label>` with an error paragraph, and `aria-describedby` wired by hand. Asked for a form, an assistant writes a label, an input and a red paragraph under it, or skips the label and relies on the placeholder.

The pieces hold until someone uses a screen reader or copies a field: the `for` and the `id` drift apart, the error is not read out because nothing points at it, and a placeholder used as the label disappears as soon as someone types. Each form spaces its labels and hints differently, and the messages say what went wrong ("Invalid") instead of what to do. With Field the ids are wired once, the layout is the same in every form, and the assistant writes only the label and the message.

## How to use it

The props, from its exported `FieldProps`:

- `label`, and `hideLabel` to hide it from the eye but keep it for screen readers.
- `hint`: short help under the control.
- `error`: the message; while it is set, the control is marked invalid.
- `required`, `requiredMark` (the asterisk, on by default) and `optional`, which marks the label as optional.
- `children`: exactly one control.

With react-hook-form, spread `register("title")` on the control and pass `errors.title?.message` to `error`; a control without a native input, such as `DatePicker`, goes through a `Controller`. `NumberField` takes `value` (a number or null), `onChange`, `min`, `max`, `step`, `unit` and `decimals`. Next to a record, a [PropertyList](https://meadowstack.com/components/property-list/) shows the facts and Field edits them in a form or a dialog. The pattern behind a whole form is the [form pattern](https://meadowstack.com/patterns/form/).

## Its entry in the manifest

*The component's rules as the kit's manifest states them, the same entry an AI coding tool reads.*

| Manifest field | Field |
| --- | --- |
| What it is | A label, the control, a hint and the error message, wired for screen readers. |
| Use it for | Around every input, select, picker and composer. |
| Not for | Around a whole group of fields (Section) |
| It replaces | A hand-written <label> with an error paragraph; Aria-describedby wired by hand |
| Screen types | Form; Settings; Record; Any |
| Import | `import { Field, Label } from "@meadowstack-studio/kit";` |

Read from the kit's component manifest when the site was built (126 components, packages/kit/src/components.json); the same entry answers an AI coding tool through the kit's MCP server.

## Where it runs in the example apps

*The example apps whose code renders Field, and in which modules, read from the demo's source.*

| Example app | Modules that render it |
| --- | --- |
| [An app for a packaging and print company](https://meadowstack.com/examples/packaging-print-production/) | Jobs, Print file editor, Quotes, Cutting dies, Colour |
| [An app for a studio or agency](https://meadowstack.com/examples/agency-capacity-planning/) | Capacity, Tasks, Finance, Channels |
| [An app for a haulage company](https://meadowstack.com/examples/haulage-dispatch-planning/) | Freight, Drivers, Costs |
| [An app for a roastery with an online shop](https://meadowstack.com/examples/coffee-roastery-production/) | Roasting, Green coffee, Shop, Wholesale |
| [An app for a sports club](https://meadowstack.com/examples/sports-club-court-bookings/) | Front desk, Courts, Club, Coaching, Rentals |
| [An app for a construction company](https://meadowstack.com/examples/construction-site-management/) | Sites, Schedule, Crews, Machines, Site diary, Drawings, Foreman's phone, Budget |
| [An app for an accounting office](https://meadowstack.com/examples/accounting-office-documents/) | Documents, Official mail, Invoicing |
| [An app for restaurants and venues](https://meadowstack.com/examples/restaurant-staff-rota/) | Shifts, Kitchen, Food safety, People, Handbook |
| [An app for one person](https://meadowstack.com/examples/personal-app-for-a-creator/) | Brand deals, Content, Money, Training |

Read from the demo's source when the site was built: 9 of 9 example apps render <Field>, in the modules named here as each app's sidebar names them.

## How the starter's form uses it

*The starter's purchase request: each control registered with react-hook-form inside its Field, the message from the zod schema, a hint on the amount and the reason, and the date picker through a Controller.*

From `templates/starter/src/modules/requests/pages/request-form.tsx` in the Meadowstack repository:

```tsx
<form id={formId} onSubmit={onSubmit} noValidate className="flex min-w-0 flex-col gap-5">
  <Field label="What do you want to buy?" required requiredMark={false} error={errors.title?.message}>
    <Input autoComplete="off" {...register("title")} />
  </Field>
  <Field label="Supplier" required requiredMark={false} error={errors.supplier?.message}>
    <Input autoComplete="organization" {...register("supplier")} />
  </Field>
  <div className="grid gap-5 sm:grid-cols-2">
    <Field
      label="Amount in euros"
      hint="Including VAT, whole euros."
      required
      requiredMark={false}
      error={errors.amount?.message}
    >
      <Input type="number" inputMode="numeric" min={1} step={1} {...register("amount")} />
    </Field>
    <Controller
      control={control}
      name="neededBy"
      render={({ field, fieldState }) => (
        <Field label="Needed by" required requiredMark={false} error={fieldState.error?.message}>
          <DatePicker
            value={field.value || null}
            onChange={(value) => field.onChange(value ?? "")}
            min={today()}
            placeholder="Pick a day"
          />
        </Field>
      )}
    />
  </div>
  <Field
    label="Why does the team need it?"
    hint="One or two sentences for the approver: what it is for and what happens without it."
    required
    requiredMark={false}
    error={errors.reason?.message}
  >
    <Textarea rows={4} {...register("reason")} />
  </Field>
</form>
```

## Questions

### Can the placeholder be the label?

No. Every input sits in a Field with a visible label. A placeholder disappears as soon as someone types, and people who come back to a half-filled form no longer see what a field asks for.

### What should an error message say?

What to do, in one short sentence, such as Choose a dish or Write who you are buying from. Not what went wrong, such as Invalid value.

### How does a screen reader hear the hint and the error?

Field gives the control an id, points aria-describedby at the hint and the error, and sets aria-invalid while there is an error, so both are read with the field.

### Should required fields get an asterisk?

By default, yes. When nearly every field is required, mark the optional ones instead: requiredMark set to false on the required fields and optional on the rest. The control gets aria-required either way.

### Can one Field hold two inputs?

No. A Field takes exactly one control. A dish and its price are two Fields side by side in a grid, and a whole group of fields goes under a Section.

## Related

- [PropertyList: label left, value right](https://meadowstack.com/components/property-list/) (Components)
- [Screen archetype](https://meadowstack.com/glossary/screen-archetype/) (Glossary)
- [Nine screen archetypes of every business app](https://meadowstack.com/guides/screen-archetypes-for-business-apps/) (Guide)
- [An invoice form that shows its totals as you type](https://meadowstack.com/screens/invoice-form/) (Screens)
- [BulkBar: what to do with the selection](https://meadowstack.com/components/bulk-bar/) (Components)
- [Composer: writing next to a record](https://meadowstack.com/components/composer/) (Components)
