Elements

Components

Editable

Editable, dressed in the paper-and-ink system: bare ink while reading, the full field recipe while editing. The parts — Root, Area, Label, Preview, Input, EditTrigger, SubmitTrigger, CancelTrigger, Control. Preview renders the machine's value as text (the asChild escape hatch stays with the Ark primitives).

#Basic usage

editable/basic Vue React
Hello World

#Props

#Area

A styled part — no props of its own; it takes the anatomy's shared styling.

#CancelTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#Control

A styled part — no props of its own; it takes the anatomy's shared styling.

#EditTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#Input

A styled part — no props of its own; it takes the anatomy's shared styling.

#Label

A styled part — no props of its own; it takes the anatomy's shared styling.

#Preview

A styled part — no props of its own; it takes the anatomy's shared styling.

#Root

PropTypeDefaultDescription
sizeString as PropType<"sm" | "md" | "lg">"md"One rung of the control-height ladder for the editing field.
activationModeeditable.ActivationMode"focus"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
autoResizebooleanWhether the editable should auto-resize to fit the content.
defaultEditbooleanWhether the editable is in edit mode by default.
defaultValuestringThe initial value of the editable when rendered. Use when you don't need to control the value of the editable.
disabledbooleanWhether the editable is disabled.
editbooleanWhether the editable is in edit mode.
finalFocusEl() => HTMLElement | nullThe element to receive focus when the editable is closed.
formstringThe associate form of the underlying input.
idstringThe unique identifier of the machine.
idsPartial<{ root: string; area: string; label: string; preview: string; input: string; control: string; submitTrigger: string; cancelTrigger: string; editTrigger: string; }>The ids of the elements in the editable. Useful for composition.
invalidbooleanWhether the input's value is invalid.
maxLengthnumberThe maximum number of characters allowed in the editable
modelValuestringThe v-model value of the editable
namestringThe name attribute of the editable component. Used for form submission.
placeholderstring | { edit: string; preview: string; }The placeholder text for the editable.
readOnlybooleanWhether the editable is read-only.
requiredbooleanWhether the editable is required.
selectOnFocusbooleantrueWhether to select the text in the input when it is focused.
submitModeeditable.SubmitMode"both"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
translationseditable.IntlTranslationsThe translations for the editable.

#SubmitTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.