Calm motion: animations on this site only fade, with no movement
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 × (dismissible) or thecloseslot prop close it and put focus back on the text. - The
#displaybutton 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
| Name | Type | Default | Description |
|---|---|---|---|
dismissible | boolean | — | |
disabled | boolean | — | |
labels | Partial<{ close: string; }> | — | |
active | boolean | false |
Events
| Name | Payload | Description |
|---|---|---|
open | [] | |
close | [] | |
update:active | [value: boolean] |
Slots
| Name | Scope | Description |
|---|---|---|
display | — | |
content | { close: () => void; } |