Editable

Inline click-to-edit text field

Category: inputs · WCAG 2.2-AA · form, editable, inline, input, text

States

Props

PropTypeDefaultDescription
valuestringThe controlled value.
onValueChange(v: string) => voidCalled with the new value when it changes.
placeholderstringPlaceholder text shown when the field is empty.
disabledbooleanfalseWhen true, disables the control and removes it from the tab order.
submitOnBlurbooleantrueWhen true, commits the edit when the field loses focus.
onCancel() => voidCalled when the edit is cancelled.
idstringId for the **focusable control** (not the wrapper), so a `<label for>` names what actually takes focus. `Field` supplies this automatically.
aria-labelledbystringWired automatically by a wrapping `Field` — its label id, forwarded to the focusable control so the Field's label names it.
aria-describedbystringWired automatically by a wrapping `Field` — the ids of its hint/error text, forwarded to the focusable control so the supporting text is announced.
aria-invalidbooleanWired automatically by a wrapping `Field` when it is in an error state.

Design tokens

When to use

When not to use

How to build an accessible Editable in React →

Examples

Basic

<Editable value="Click to edit" onValueChange={() => {}} />

With placeholder

<Editable value="" onValueChange={() => {}} placeholder="Enter text" />

Related components

← Back to docs