Components / Text & numbers
EditableText
Inline click-to-edit text, single or multi-line.
@ruckc/truss-ui Text & numbers
Import
import { EditableText } from '@ruckc/truss-ui'; Playground
value
API
| Prop | Type | Default | Description |
|---|---|---|---|
value bindable | string | '' | The current value. Bind it with `bind:value`. |
placeholder | string | 'Click to edit' | Hint shown while the field is empty. |
multiline | boolean | false | Enter inserts a newline; Ctrl/⌘+Enter commits. |
selectAll | boolean | true | Select the whole text when editing starts. |
disabled | boolean | false | Disables the control: it cannot be focused, changed or activated. |
label | string | 'Edit text' | Accessible name of the edit control. |
onconfirm event | (value: string) => void | — | Called when the user confirms. |