GitHub

Editable

A component that allows users to edit text in place.

Edit user
Click in the field or edit button to start editing
Vinicius Vicentini
@vinihvc

Installation

Usage

Activation Modes

The activationMode prop controls how editing is triggered.

Focus

Editing starts when the field receives focus.

Edit with focus
Focus the field to start editing (default activation mode)
Vinicius Vicentini
@vinihvc

Click

Editing starts with a single click on the preview.

Edit with click
Click the text to start editing
Vinicius Vicentini
@vinihvc

Double-Click

Editing starts with a double-click on the preview.

Edit with double-click
Double-click the text to start editing
Vinicius Vicentini
@vinihvc

None

No automatic activation. Use EditableEditTrigger to manually start editing.

Edit with manual trigger
Use the edit button to start editing (no automatic activation)
Vinicius Vicentini
@vinihvc

Sizes

You can change the size of the editable preview using the size prop on EditablePreview.

Extra Small

Editable content

Small

Editable content

Large

Editable content

Extra Large

Editable content

Examples

With Textarea

Edit description
Double-click the text to start editing
This is a longer description that can be edited. Click to edit and make changes.

Without Controls

Edit without control buttons. Press Enter to save, Escape to cancel.

Edit without controls
Click the field to edit, press Enter to save, Escape to cancel
Vinicius Vicentini
vinicius@example.com

Controlled

Make the entire form editable at once by using the edit prop.

You can also use the value and onValueChange props to control the editable component.

Edit user
Click the edit button to start editing
Vinicius Vicentini
@vinihvc

Orientation

The orientation prop controls the layout of the editable component and its controls.

Horizontal

Controls are displayed horizontally next to the editable area. This is the default.

Editable content

Vertical

Controls are displayed vertically next to the editable area. Useful for multi-line editable content.

Editable content

API Reference

Editable

Root element of the editable component. Renders a div.

EditableArea

Container for the editable input and preview. Renders a div.

EditableInput

Input element for editing. Renders an input or custom element when using asChild.

EditablePreview

Preview element that displays the value when not editing. Renders a span.

EditableControl

Container for the control buttons. Renders a div.

EditableEditTrigger

Button that triggers edit mode. Renders a button.

EditableCancelTrigger

Button that cancels editing and reverts changes. Renders a button.

EditableSubmitTrigger

Button that submits the edited value. Renders a button.


For a complete list of props, see the Ark UI documentation.