Skip to content
Theme:

Ui3nEditable ​

Inline editable text component. Click on the text to enter edit mode, press Enter or click the checkmark to confirm, press Escape or click the cross to cancel.

Props

NameTypeDefaultDescription
idstring | undefined —

Root element id

namestring | undefined —

HTML name attribute for form submission

modelValue*string —

Current value of the editable content

placeholderstring | undefined —

Placeholder text

maxLengthnumber | undefined —

Maximum length of the text

maxWidthstring | number | undefined —

Maximum width of the component

tooltipWidthnumber | undefined —

Tooltip width

disabledboolean | undefined —

Component disabled flag

selectAllOnFocusboolean | undefined —

Flag for automatic selection of all text on focus

disallowEmptyValueboolean | undefined —

Flag to prevent empty values

Events

Event NameArguments / Value TypeDescription
update:modelValuevalue: Nullable<string> —
done —
cancel —
focusinvalue: FocusEvent —
focusout —
toggle:editModevalue: boolean —

Public Methods & Exposes

Method NameSignature / TypeDescription
clear()() => void —

CSS Variables

Set any of these where you need it — on :root, on a container, or on the element itself through [data-ui3n] — and the component follows. Leave them alone and it uses the defaults below.

NameDefault
--ui3n-editable-border-radius4px
--ui3n-editable-button-size16px
--ui3n-editable-font-size12px
--ui3n-editable-height24px
--ui3n-editable-max-width100%
--ui3n-editable-min-width60px

Usage Examples ​

Basic usage ​

Basic usage

Click on the text to enter edit mode. Press Enter to confirm or Escape to cancel.

Editable text
Current value: Editable text

Disallow empty value ​

Disallow empty value

Using disallowEmptyValue prop prevents saving an empty value. The input border turns red when the value is empty.

Required field
This field cannot be empty (disallowEmptyValue)

Disabled state ​

Disabled state

Disabled component does not allow entering edit mode.

Disabled field
Disabled state — editing is not available