# Label with inline edit toggle

> Label with inline edit toggle

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-label-12).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-label-12
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-label-12-light-be41e3fb04143446.png
- Registry item: https://reui.io/r/new-york-v4/c-label-12.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-label-12.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `button`, `field`, `input`, `label`

## Files

### `c-label-12.tsx`

```tsx
"use client"

import { useState } from "react"

import { Button } from "@/components/ui/button"
import { Field, FieldDescription } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"

export function Pattern() {
  const [isEditing, setIsEditing] = useState(false)
  const [value, setValue] = useState("My Awesome Project")

  return (
    <Field className="w-full max-w-xs">
      <Label htmlFor="label-inline-edit" className="gap-2">
        Project Name
        <Button
          size="icon-xs"
          variant="ghost"
          onClick={() => setIsEditing(!isEditing)}
        >
          {isEditing ? (
            <IconPlaceholder
              lucide="CheckIcon"
              tabler="IconCheck"
              hugeicons="Tick02Icon"
              phosphor="CheckIcon"
              remixicon="RiCheckLine"
              className="size-3.5"
            />
          ) : (
            <IconPlaceholder
              lucide="PencilIcon"
              tabler="IconPencil"
              hugeicons="PenIcon"
              phosphor="PencilIcon"
              remixicon="RiPencilLine"
              className="size-3.5"
            />
          )}
        </Button>
      </Label>
      {isEditing ? (
        <Input
          id="label-inline-edit"
          value={value}
          onChange={(e) => setValue(e.target.value)}
          autoFocus
        />
      ) : (
        <FieldDescription>{value}</FieldDescription>
      )}
    </Field>
  )
}
```
