Skip to content

Settings

Inline rename

Edit a name in place: display until invited to edit, then a field, with optional delete.
Available
Ports as-is

Examples

Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.

Inline rename

Rendered live from Storybook

Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.

Props

The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.

PropTypeDefaultDescription
value*string—The current name. Also the value the editor seeds and reverts to.
onRename(nextValue: string) => void—Fired with the trimmed new name on confirm. Empty input is treated as a cancel.
onDelete() => void—Shown when the row's delete affordance is used. Omit to hide the trash button.
initialEditingbooleanfalseLifts the editing state so both halves of this component are static stories: `true` renders the input + confirm/cancel cluster on mount.
editingboolean—Controlled editing state. Supply with `onEditingChange`.
onEditingChange(editing: boolean) => void—Undocumented — add TSDoc to the prop in the library.
renderActions(startEdit: () => void) => React.ReactNode—Replaces the default pencil/trash cluster. Receives `startEdit` so a DropdownMenu can drive the same editor from an "Edit name" item — that is exactly how the GHL account card uses it.
placeholderstring"Name"Undocumented — add TSDoc to the prop in the library.
autoFocusbooleantrueFocus the field when editing begins. Defaults to true; gallery stories turn it off so they do not fight over focus.
displayClassNamestring—Classes on the resting label.
classNamestring—Undocumented — add TSDoc to the prop in the library.

Reference

Transcribed from the component audit. If this disagrees with the source, the source is right.

Source
src/components/settings/InlineRename.tsx
Portability
Copies across unchanged — only the utils import path moves.
States to cover
displayeditingwith custom actionsempty placeholder
Props the port adds
editing / onEditingChange for a controlled view, or initialEditing to render either state statically
Notes
The shared extraction the audit called for — GHLAccountCard and GHLActiveKeys each had their own copy.