Skip to content

Editable

Free

Text that turns into a field when you press it, such as a page title or a table cell. Enter or a click outside saves it, and Escape undoes it.

  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Wrap a preview and an input in an area. A press, Enter, or a double click opens the field; Enter or a blur saves, Escape cancels.

report-title.tsx

Editable

<div>
PropTypeDefaultDescription
valuestring—The saved text (controlled).
defaultValuestring""The saved text at mount.
onValueChange—Called with the new text after a save (after onSubmit resolves).
onSubmit—Called on a save with the new text. Return a Promise for an async save: the field turns read-only and the Submit trigger spins; a reject keeps the field open with its message.
onCancel—Called when an edit ends with no save (Escape, Cancel, or an empty text).
editingboolean—Shows the field (controlled).
defaultEditingbooleanfalseShows the field at mount (a rename started from a menu).
onEditingChange—
activationMode"click""dblclick""focus""none""click"What opens the field: click (default; Enter, Space, or F2 on the focused preview too), dblclick (a list where a click selects; Enter and F2 still open it), focus, or none (only editing and the Edit trigger).
submitMode"blur""both""enter""none""both"What saves: both (default: Enter and a blur), enter, blur, or none. A blur that does not save cancels.
selectOnFocusbooleantrueSelects the text when the field opens. Default true; else the caret goes to the end.
multilinebooleanfalseMany lines: Enter adds a line, Mod+Enter saves. Use EditableTextarea.
placeholderstring—The muted text of the preview when the text is empty.
disabledbooleanfalse
readOnlybooleanfalseNo edit; the text stays selectable.
invalidbooleanfalseThe field shows the error look, and Enter and a blur do not save.
allowEmptybooleanfalseSave an empty text. Default false: an empty text cancels.
size"default""lg""sm""default"
variant"ghost""outline""ghost"ghost (default): text with no edge at rest. outline: the field edge at rest, for a form.
rounded"default""full""default"
width"fill""fit"multiline ? "fill" : "fit"fit: as wide as the text (default for one line). fill: the full row (default for many).
labels—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

EditableArea

<div>
PropTypeDefaultDescription
indicatorbooleantrueThe pencil hint after the box: a 24px slot that is always there, so the box keeps its place when the pencil fades in on hover or focus. No pencil on a touch screen. Default true; turn it off with the Edit trigger or in a table cell.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

EditablePreview

<button>
PropTypeDefaultDescription
childrenReactNode—Custom text in the preview. Default: the saved text, or the placeholder.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

EditableInput

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

EditableTextarea

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

EditableControls

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

EditableEditTrigger

<button>
PropTypeDefaultDescription
classNamestring—
busyboolean—The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading.
spinnerPlacement"center""start"—center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label.
glass"clear""dark""light"—
rounded"default""full"—
size"default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs"—
variant"dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary"—
childrenReactNode—
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether the button should be focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

EditableSubmitTrigger

<button>
PropTypeDefaultDescription
classNamestring—
busyboolean—The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading.
spinnerPlacement"center""start"—center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label.
glass"clear""dark""light"—
rounded"default""full"—
size"default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs"—
variant"dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary"—
childrenReactNode—
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether the button should be focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

EditableCancelTrigger

<button>
PropTypeDefaultDescription
classNamestring—
busyboolean—The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading.
spinnerPlacement"center""start"—center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label.
glass"clear""dark""light"—
rounded"default""full"—
size"default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs"—
variant"dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary"—
childrenReactNode—
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether the button should be focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

EditableError

<p>
PropTypeDefaultDescription
...props<p> attributes—Every other attribute goes to the <p>, with a ref.
  • Use it for a title, a name in a list, or a table cell that people rename.
  • Use onSubmit with a promise to save to a server: it shows a spinner and the error.
  • Use multiline with EditableTextarea for many lines.
  • For a field that people always fill in, use an Input.
  • For many fields that save together, use a Form.
EnterorSpaceorF2On the preview: opens the field with the text selected.
EnterIn the field: saves. With multiline, adds a line.
ModEnterWith multiline: saves.
EscapePuts the old text back and closes the field.
Swap
none · the preview and the field share one box, so nothing moves
Hover
hover · the preview tints and the pencil fades in

Built with

Installs with Editable

  1. AddedEditable, with Button, Input, Textarea.
Open the release