---
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/"
---

# Label

The words that name one form control, tied to it so a press on them focuses it, for React and Tailwind CSS. Free, MIT.

Free. Its export: `Label`.

## Try it

Change the words, disable it with its field; press the words and the focus goes into the field.

Nothing is saved: the field keeps what you type until Reset.

## When to use

- The words that name one form control, tied to it so a press on them focuses it.
- Also called: form label.

## 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 Label 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/trail-label
```

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

## Usage

```tsx
import { Label } from '@/components/ui/goop/label';
import { TextInput } from '@/components/ui/goop/text-input';

<div className="flex flex-col gap-1.5">
  <Label htmlFor="project-name">
    Project name
  </Label>
  <TextInput id="project-name" placeholder="Untitled project" />
</div>
```

- Fits: settings, flow: field.
- width, text: add no class for these.

## API reference

### Options

- `disabled?: boolean` — Dims the words to half, as the field dims its words when disabled; the control is disabled by its caller.
- `htmlFor?: string`

## 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

- [Text input](/themes/trail/components/text-input): A single-line field for free words, such as a name, a title or an email.
- [Field](/themes/trail/components/field): A form row that ties one control to its label, its description and its error line, as a settings row or a stacked form field.
- [Field error](/themes/trail/components/field-error): The error line under a form control whose value was refused, saying what to fix, inside the control's Field.
- [Textarea](/themes/trail/components/textarea): A multi-line field for free text, such as a description or a comment, that grows by rows as a person types.
