Use the size prop to change the size of the editable.
Click to edit
Click to edit
Click to edit
Click to edit
React
Double Click
Use the activationMode prop to make the content editable when users double click.
Double click to edit
React
With Controls
Add controls such as "edit", "cancel" and "submit" to Editable for better user experience.
Click to edit
React
Controlled
Use the value and onValueChange props to control the editable component.
Click to edit
React
Props
Root
Prop
Default
Type
size
'md'
'2xs' | 'xs' | 'sm' | 'md' | 'lg'
activationMode
\focus\
ActivationMode
The activation mode for the preview element.
- "focus" - Enter edit mode when the preview is focused
- "dblclick" - Enter edit mode when the preview is double-clicked
- "click" - Enter edit mode when the preview is clicked
- "none" - Edit can be triggered programmatically only
selectOnFocus
true
boolean
Whether to select the text in the input when it is focused.
submitMode
\both\
SubmitMode
The action that triggers submit in the edit mode:
- "enter" - Trigger submit when the enter key is pressed
- "blur" - Trigger submit when the editable is blurred
- "none" - No action will trigger submit. You need to use the submit button
- "both" - Pressing `Enter` and blurring the input will trigger submit
asChild
boolean
Use the provided child element as the default rendered element, combining their props and behavior.
autoResize
boolean
Whether the editable should auto-resize to fit the content.
defaultEdit
boolean
Whether the editable is in edit mode by default.
defaultValue
string
The initial value of the editable when rendered.
Use when you don't need to control the value of the editable.
disabled
boolean
Whether the editable is disabled.
edit
boolean
Whether the editable is in edit mode.
finalFocusEl
() => HTMLElement | null
The element to receive focus when the editable is closed.