Componentform1.03 KB gzipZero dependencies
Inline Edit
Click-to-edit field with focus outline, animated save pulse, and cancel action.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add inline-editOr install the full npm package:
npm install bigbulluiUsage
tsx7 lines
import { InlineEdit } from "@/components/ui/inline-edit"; <InlineEdit label="SEAT ASSIGNMENT" defaultValue="ROW C · SEAT 12" onSave={(val) => console.log(val)}/>Source code
inline-edit.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxinline-edit.tsx147 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface InlineEditProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> { value?: string; defaultValue?: string; onSave?: (newValue: string) => void; placeholder?: string; label?: string; className?: string;} export function InlineEdit({ value: controlledValue, defaultValue = "", onSave,Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { InlineEdit } from "@/components/ui/inline-edit"; <InlineEdit />| Prop | Type | Description |
|---|---|---|
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. (Default: "") |
| onSave | (newValue: string) => void | Callback invoked on save. |
| placeholder | string | Placeholder text shown when empty. (Default: "Click to edit...") |
| label | string | Accessible label text rendered or attached to the control. |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |