Inline edit
Text that becomes a field in place to rename something, such as a title or a table cell, without moving. Quiet saves at once with a mark after the text; Actions keeps Save and Cancel in the field until the save is done.
Examples
Default
Give it a label and save in onValueChange. The text stays where it is as the field opens, and a promise shows a spinner after the text, then a tick.
Table cells
Pass value to own it, and validate to refuse a name: here, one another file already has.
Actions
The actions variant shows a pencil at rest and Save and Cancel in the field, which stays open until the save is done.
Controlled
Own editing to open the field from elsewhere, such as a Rename item in a menu.
Created just now by you
Placeholder
An empty value shows the placeholder, muted, in its place, and the field opens empty.
Installation
npx shadcn@latest add https://kinoui.com/r/inline-edit.json- Files
components/kino/label.tsxlib/reduce-motion.tslib/resize.tslib/settle.tscomponents/kino/field.tsxlib/refs.tscomponents/kino/input.tsxcomponents/kino/textarea.tsxlib/swap.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxcomponents/kino/input-group.tsxlib/announce.tsxlib/controllable.tslib/notice.tsxcomponents/kino/inline-edit.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Props
Data attributes
CSS variables
Accessibility
- At rest the text is a button named by the text itself, so a heading it sits in keeps its own name; its description says what pressing it does, and why a save failed.
- A press, Enter, Space or F2 opens the field with focus in it and the whole text picked; Enter and Escape put focus back on the text, and a press elsewhere leaves it where it went.
- Escape puts the text back from the field or from Save and Cancel, and stops there, so a dialog the edit sits in stays open.
- A held Enter never opens and closes the field over and over, and Enter that picks a word in an input method editor never saves.
- An invalid value marks the field invalid, links its message, and shows a mark and words, not a colour alone; the message is read out as it appears.
- A polite status region says when a save that took a moment has worked; a failure is read out with its message.
- Save and Cancel are named buttons, gone from the tab order and from screen readers at rest.