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

# Inline edit

Words that read as plain text and become an editable field in place, such as a record's title or a property's value, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `InlineEdit`.

## Try it

Click the title, the site, the empty contact or the note (or Tab onto one and press Enter, Space or F2) and type: Enter or a click away saves, Escape puts the words back, and in the title and the note Shift+Enter breaks the line. The line under the record says what the last save or Escape did.

The study is our own and lives in this page alone: nothing is saved anywhere.

## When to use

- Words that read as plain text and become an editable field in place, such as a record's title or a property's value.

## 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 Inline edit on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-inline-edit.json --yes
```

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

## Usage

```tsx
import { useState } from 'react';
import { InlineEdit } from '@/components/ui/goop/inline-edit';
import { Progress } from '@/components/ui/goop/progress';
import { Properties, PropertyRow } from '@/components/ui/goop/properties';

function Visit() {
  const [title, setTitle] = useState('Survey the ridge path before the spring walk');
  const [place, setPlace] = useState('North meadow');
  return (
    <div className="flex w-80 flex-col gap-4">
      <InlineEdit as="h1" variant="title" multiline label="Title" value={title} onValueChange={setTitle} />
      <Properties>
        <PropertyRow label="Place">
          <InlineEdit value={place} onValueChange={setPlace} placeholder="Add a place" />
        </PropertyRow>
      </Properties>
    </div>
  );
}
```

- Fits: record (its recipe).
- Also known as: Editable, EditableText, ClickToEdit.
- height, width, padding, corner, text, motion: add no class for these.

## API reference

### Options

- `variant: default | title = default`
- `value?: string` — The saved words (controlled); pair it with `onValueChange`.
- `defaultValue?: string = ''` — The words it starts with (uncontrolled).
- `onValueChange?: (value: string) => void` — Called with the new words when a save changes them (Enter, or the focus leaving), never while typing.
- `onSave?: (value: string) => void` — Called with the words on every save, changed or not, after `onValueChange`.
- `onCancel?: () => void` — Called when Escape ends the editing and puts the saved words back.
- `label?: string` — What the value is, for a screen reader: the button reads "Edit <label>" and the field is named `<label>`.
- `placeholder?: string` — The words shown, in the placeholder grey, while the value is empty; the field's own placeholder too.
- `multiline?: boolean = false` — A multi-line field (a textarea growing with its words): Enter saves, Shift+Enter breaks the line.
- `disabled?: boolean = false` — Off: the words read and nothing opens them.
- `as?: 'div' | 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' = 'div'` — The element round the words in both states: a `div` by default, `h1` for a page's title.
- `id?: string` — The control's id (the reading button's, then the field's): what a `<label htmlFor>` points at.

- State: value (value / defaultValue / onValueChange)

## Keyboard

- Enter / Space / F2: on the words: open the field holding them, focused, the words chosen
- Enter: in the field: save the words and put the focus back on them (Shift+Enter breaks the line in a multi-line field)
- Escape: in the field: put the saved words back and the focus on them; a dialog round it stays open
- Tab: in the field: save the words and move on to the next control

## Accessibility

- The native element answers the keyboard.
- hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing
- disabled: the prop disabled

## Motion

- The part sets its own motion: add no transition or animation of your own.

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

- [Progress](/themes/meadow/components/progress): A bar that fills as work goes on, for an upload or a setup with a known end, or that sweeps while the end is unknown.
- [Properties](/themes/meadow/components/properties): A record's properties, each a quiet value named by an icon or a label, such as who, where and when, for a record's panel.
- [Month calendar](/themes/meadow/components/month-calendar): A month of events, a row a week and a cell a day, each day listing its events as chips in their colours.
- [Plan card](/themes/meadow/components/plan-card): One plan to pick on a pricing or billing page, with its price, what it holds and its button.
