Skip to content
GitHub

Editable

Allows user to edit text in-place.

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

Installation

Usage

Controlled

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

The value and onValueChange props control the editable component programmatically.

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

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

The size prop on EditablePreview controls the preview dimensions.

Small

Editable content

Large

Editable content

Orientation

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

Horizontal

Editable content

Vertical

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

API Reference

Editable

Root component. Manages edit mode and value.

EditableArea

Wraps the input and preview views.

EditableInput

Input shown when editing. Use asChild for custom input elements.

EditablePreview

Shows the value when not editing. Click to enter edit mode.

EditableControl

Holds edit/cancel/submit control buttons.

EditableEditTrigger

Enters edit mode on click.

EditableCancelTrigger

Cancels editing and reverts to previous value.

EditableSubmitTrigger

Submits the edited value and exits edit mode.


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