Skip to content
Design System
GitHub

Text that reads as plain text until it is edited in place: a click, Enter or F2 turns it into a field of the same size, Enter or leaving the field saves, Esc puts the text back.

Click the title, or Tab to it and press Enter or F2.

Title

Install
npx shadcn add @syncrobotic/inline-edit

Also installs: @syncrobotic/cn, @syncrobotic/input

Overview

When to use

  • A page's title the viewer may rename, in the top bar: action-rail-shell takes onTitleChange.
  • A dataset's, run's or robot's name in its page header or a card's title.

Use something else

  • Several fields, or a name with rules people must read first: Dialog with an Input in a Field.
  • A value that is not text (a number, a date, a choice): its own field.

More examples

States and real uses. Each example is also a Storybook story and a visual regression test.

Card title

Usage rules

  • For one short name renamed where it is shown: a page title, a dataset or a robot's name. A form's fields stay Inputs with labels; never a page of these.
  • At rest it is the text itself: no edge and no icon, only the hover fill. Give it the type of the text it replaces through className, so the field opens at the same size and nothing moves.
  • An empty or unchanged value saves nothing. Check the name in onChange, and say why a rejected one was refused in a toast, keeping the old name.
  • label says what editing does (Rename dataset): it names the field and describes the text at rest.

Changelog

  • 0.69.02026-12-03New: a name or title renamed where it is shown (a page title, a dataset name), controlled by value and onChange.

How to upgrade