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.
By Bohuslav PoláčekChecked
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, 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 failsnpm 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'serror. - 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 andoptionalon the rest (GOV.UK's rule, in the kit'sFieldProps). - Readable in every state. Labels, hints and placeholders at 12 and 13px are
text-fgortext-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:useBlockerwithuseConfirm).
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, andhideLabelto 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) andoptional, 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 shows the facts and Field edits them in a form or a dialog. The pattern behind a whole form is the form pattern.
Its entry in the manifest
| 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"; |
Where it runs in the example apps
| Example app | Modules that render it |
|---|---|
| An app for a packaging and print company | Jobs, Print file editor, Quotes, Cutting dies, Colour |
| An app for a studio or agency | Capacity, Tasks, Finance, Channels |
| An app for a haulage company | Freight, Drivers, Costs |
| An app for a roastery with an online shop | Roasting, Green coffee, Shop, Wholesale |
| An app for a sports club | Front desk, Courts, Club, Coaching, Rentals |
| An app for a construction company | Sites, Schedule, Crews, Machines, Site diary, Drawings, Foreman's phone, Budget |
| An app for an accounting office | Documents, Official mail, Invoicing |
| An app for restaurants and venues | Shifts, Kitchen, Food safety, People, Handbook |
| An app for one person | Brand deals, Content, Money, Training |
How the starter's form uses it
<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.
Two ways
Build it yourself, or have it built
Build it yourself
Build your app on the framework
Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.
One payment, lifetime updates
Get the frameworkHave it built
Have us build your app
Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.
After launch, Care keeps it improving, from €99 a month.
from €1,990
Describe your app