# InlineEdit

Change a value in place, with validation and an explicit path back.

- Family: Interaction, imported from `mizu-ui` or `mizu-ui/interaction`
- Docs: https://mizu.user64bit.world/components/inline-edit
- Source: https://github.com/0xuser64bit/mizu/blob/main/packages/mizu/src/interaction/InlineEdit.tsx

## Usage

```tsx
"use client";

import { useState } from "react";
import { InlineEdit } from "mizu-ui";

export function Example() {
  const [value, setValue] = useState("Untitled release");
  return (
    <InlineEdit
      label="Release name"
      value={value}
      onValueChange={setValue}
      validate={(v) => (v.trim() ? undefined : "A release needs a name.")}
    />
  );
}
```

## Copy it with the shadcn CLI

```sh
npx shadcn@latest init 0xuser64bit/mizu/preset # once, where there is no components.json
npx shadcn@latest add 0xuser64bit/mizu/inline-edit
```

## Props

- `label / value / onValueChange`: `string / string / function`. Name and committed value.
- `validate`: `(value: string) => string | undefined`. Return an error message to keep the draft open.

## Accessibility

Editing focuses a labelled input. Enter saves, Escape/Cancel discards; focus returns to the trigger. Validation errors are linked and announced. Blur never silently commits.

## Motion

CSS transitions explain state changes. Reduced motion removes travel.
