Skip to content

Inplace ​

Click-to-edit

A value shown as text until someone clicks it to change it — a title, a name in a list. It keeps a page readable when editing is occasional. When most visitors will edit, show the field.

Basic
click the title · Enter, Esc or × to finish
  • Opening moves focus into the first control of #content; Esc, the × (closable) or the close slot prop close it and put focus back on the text.
  • The #display button needs text that says it can be edited — the value itself usually does, but an empty value needs a placeholder ("Add a title").

Usage ​

ts
import { BlessInplace } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
closableboolean—
disabledboolean—
closeLabelstring"Close"
activebooleanfalse

Events

NamePayloadDescription
open[]
close[]
update:active[value: boolean]

Slots

NameScopeDescription
display—
content{ close: () => void; }

Released under the MIT License. Character names and artwork belong to their owners.