Aliases
editable text, inline rename
components / inlineedit
Display-first field that expands into focused editing for quick metadata changes without leaving the current layout.
Playground
Start here. Switch systems, interact with the shipped component, and let the rest of the page answer the why and how after the behavior clicks.
Cobalt
The crisp default DK action system: bright primary, roomy spacing, and a direct editorial rhythm.
Overview
This section explains the intent of the component before the implementation details.
Aliases
editable text, inline rename
Explore the math
Decision guide
Use these notes to decide quickly whether this is the right DK component for the job.
Decision guide
Do
Do not
Usage
Prefer these situations when choosing this component.
Usage
These patterns are better served by a different component or a simpler surface.
Anti-patterns
Migration notes
Anatomy
The anatomy explains which pieces matter to the recipe and accessibility model.
read state
displayNon-editing surface that shows the committed value.
active editor
fieldInput or textarea that appears while editing.
commit controls
actionsSave/cancel controls for multiline editing.
API
The docs contract distinguishes props, DOM events, and slots so integration behavior is explicit.
Props
| Name | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled committed value. |
label | string | — | Visible label for the inline editor. |
description | string | — | Supporting helper copy. |
placeholder | string | — | Placeholder shown when the value is empty. |
disabled | boolean | false | Disables entry into editing mode. |
multiline | boolean | false | Switches the editor into textarea mode. |
onChange | (detail: { value: string }) => void | — | Callback fired while the draft changes. |
onCommit | (detail: { value: string }) => void | — | Callback fired when the edit is committed. |
onCancel | (detail: { value: string }) => void | — | Callback fired when editing is cancelled. |
theme | ThemeContract | — | Overrides the compiled DK theme used to resolve tokens and recipes for this component. |
Events
| Name | Payload | Description |
|---|---|---|
change | { value: string } | Fires while the draft changes. |
commit | { value: string } | Fires when the edit is committed. |
cancel | { value: string } | Fires when the edit is cancelled. |
Slots
| Name | Description |
|---|---|
default | InlineEdit is prop-driven in v1 and does not expose slot-based adornments. |
Recipes
These notes summarize the intended recipe surface rather than exposing raw implementation detail first.
Variants
Sizes
States
Accessibility
This is the behavior the component promises to assistive tech and keyboard users today.
Semantics
Keyboard
Screen readers
Checklist
Implementation
This section shows the representative compiled slot variables that the runtime consumes for the selected design system.
Implementation notes
Implementation checklist
Examples
Each example is intentionally practical, grouped by starter, common pattern, and edge-case coverage.
Starter
1 example
starter
Starter: in-place renameClick the label to enter editing mode without leaving the page.
Copy snippet
<InlineEdit label="Project name" value="Launch roadmap" onCommit={(detail) => saveName(detail.value)} />Common patterns
1 example
common
Common: short note editingMultiline mode adds explicit save/cancel controls for draft management.
Copy snippet
<InlineEdit multiline={true} label="Release note" value="Add rollout caveats here." />Edge cases
1 example
edge
Edge: locked metadataDisable the editor when the current user can review but not change the value.
Copy snippet
<InlineEdit label="Project name" value="Launch roadmap" disabled={true} />Verification
Proofs stay visible in the docs so the system shows what it can guarantee, not just what it can render.
size=md