---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Field

A form row that ties one control to its label and its description, as a settings row or a stacked form field, for React and Tailwind CSS. Free, MIT.

Free. Its export: `Field`.

## Try it: field

Turn the settings on and off by the switch, its label or Space: each change saves at once and the line under the list says so. Text alerts are refused and the switch goes back.

The save is a timer; the refusal is our own rule (the sample account has no phone number).

## Try it: field-avatar

Press the round avatar (or Tab to it and press Enter) and choose a picture: it shows at once and uploads for a moment. A file over 2 MB or not a picture is refused in the row; Remove puts the initials back.

The upload is a timer; the picture never leaves the page. The theme ships no picture chooser for this row: the avatar-as-button and its hidden file field are this example’s own composition.

## Try it: field-button

Press Export: the button is busy for a moment, then the row says the file is ready. Press Sign out: the other sessions end and the button switches off.

Both are timers: no file is made and no one is signed out.

## Try it: field-edit

Press the pencil to edit the address in place and Save: an address without an @, or lucia@fieldwork.test (in use), is refused under the field; a good one is saved after a moment. Cancel or Escape leave it as it was; the focus returns to the pencil.

The save is a timer; the address in use is our own sample.

## Try it: field-icon

Press an icon to cycle it and type the name; Look puts the pairs in two settings rows or bare as a form’s title line. In the rows, switch row or column, the hairline, stacking on a phone (seen under 641 px) and invalid; disable them in either.

Nothing is saved; the picker cycles five icons instead of opening a list.

## Try it: field-select

Choose a start page or how names are shown: each choice saves at once (the line under the list says so) and the row’s description follows the name choice.

The save is a timer; the name is our own sample.

## Try it: field-stacked

Type a start and an end; switch the column to a row, add a description, disable the fields, mark the end invalid.

The times are not checked: "Invalid" only marks the end box.

## Try it: field-tile

Press a row’s words or its switch to turn it on; switch row or column, the hairline, stacking on a phone (seen under 641 px), disabled, the descriptions and the tiles.

Nothing is saved: the rows only say their state.

## When to use

- A form row that ties one control to its label and its description, as a settings row or a stacked form field.
- Also called: form field or form control.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Field on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

```sh
npx shadcn@4.23.1 add @goop/meadow-field
```

```text
Add the Goop Field to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { FieldValue } from '@/components/ui/goop/field';

import { Button } from '@/components/ui/goop/button';
import { Field } from '@/components/ui/goop/field';
import {
  Select,
  SelectContent,
  SelectIcon,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from '@/components/ui/goop/select';
import { TextInput } from '@/components/ui/goop/text-input';

function CalendarSettings() {
  return (
    <ul className="flex flex-col">
      <Field as="li" label="Survey calendar" description="Site visits you create are added here.">
        {(control) => (
          <Select defaultValue="field">
            <SelectTrigger size="lg" {...control}>
              <SelectValue />
              <SelectIcon />
            </SelectTrigger>
            <SelectContent aria-label="Calendars">
              <SelectItem value="field">Field survey calendar</SelectItem>
              <SelectItem value="office">Office calendar</SelectItem>
            </SelectContent>
          </Select>
        )}
      </Field>
      <Field
        as="li"
        tone="danger"
        stack="always"
        label="Delete workspace"
        description="Removes its plans and notes."
      >
        <Button variant="destructive" size="page">
          Delete workspace
        </Button>
      </Field>
    </ul>
  );
}

function CrewForm() {
  return (
    <div className="flex flex-col gap-3">
      <Field label="Start" orientation="vertical">
        <TextInput defaultValue="08:30" />
      </Field>
      <Field label="Guest" orientation="inline">
        <TextInput variant="bare" type="email" />
      </Field>
    </div>
  );
}
```

- Fits: account, flow, settings (their recipes).
- Field is one piece: `label` and `description` are its props, with no label or description part to import. A bare Field is a settings row: rows go in a `ul` on the page, or in a `Card variant="outline"` (the card on the `ul`, or the `ul` straight in it), which sets them 12 px in and rules them; a form's label over its control is `orientation="vertical"`. A select needs its trigger wired: `<Field label="Default calendar">{(control) => (<Select><SelectTrigger {...control}><SelectValue /> </SelectTrigger>…</Select>)}</Field>`.
- FieldValue: A value with its edit button: `<Field label="Email">{(control) => (<><FieldValue>sam@example.com</FieldValue> <IconButton aria-label="Change email" {...control}>…</IconButton></>)}</Field>`.
- More on where it goes: field--options.md
- height, width, padding, gap, border, background, text: add no class for these.

## API reference

### Options

- `orientation: horizontal | vertical | inline = horizontal`

- Each option with its sentence: field--options.md

### Parts

- `FieldValue` — The row's current value, shown before its control (an address before its edit button)

- Class recipes (cva): fieldVariants (Field)
- data-slot values (to select a part by): field, field-content, field-control, field-description, field-label, field-media, field-value

### Field: every option

```tsx
import { Field } from '@/components/ui/goop/field';
```

### Compose

- FieldValue: A value alone (a review step, a read-only fact) takes the control's id: `{(control) => <FieldValue id={control.id}>Rowan Hale</FieldValue>}`.

### Options

- orientation: horizontal (default), vertical, inline
- as?: 'div' | 'li' = 'div' — `li` makes the row an item of its list (a settings list's `ul`); a `div` by default.
- ref?: Ref<HTMLDivElement | HTMLLIElement> — The row's element: the `div`, or the `li` with `as="li"`.
- label: ReactNode — The control's name, shown over or before it; a press on it reaches the control.
- description?: ReactNode — A grey line under the label, read out with the control; none by default.
- separator?: boolean — The hairline under the row: `true` draws it always, `false` never; left out, it is drawn under every row but not under the last of its siblings (an inline row draws it under the last too).
- disabled?: boolean — Dims the words to half and disables the control the field wires; off by default.
- media?: ReactNode — What the row shows before its words (an icon tile marking the row's subject).
- stack?: boolean | 'always' — Whether the row stacks its words above its control: `"always"` at every width; `true` any row at or below 640 px; `false` never (a field-shaped control stays beside its words).
- tone?: 'default' | 'danger' = 'default' — `default`; `danger` draws the title in the destructive red (a section that deletes or ends something).
- children: ReactElement<Partial<FieldControlProps>> | ((control: FieldControlProps) => ReactNode) — The control (a Switch, TextInput, Select, Textarea or Slider) or a function given its wiring.
- Types: FieldControlProps = { id: string; 'aria-describedby'?: string; disabled?: boolean }

## Accessibility

- hover: the browser's own (:hover): write nothing
- disabled: the attribute data-disabled

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

## Related

- [Button](/themes/meadow/components/button): A button with words that runs an action, in several looks and sizes, on a page, in a row or in a sidebar.
- [Select](/themes/meadow/components/select): One option from a short closed list.
- [Text input](/themes/meadow/components/text-input): A single-line field for free words, such as a task's title, a name or an email.
- [Field error](/themes/meadow/components/field-error): The error line under a form control whose value was refused, saying what to fix, inside the control's Field.
