Components · Form & Input
Inline Edit
BetaAdded v6.1.0
Text that becomes an input on click, for renaming things in place.
import { InlineEdit } from '@nexub/react';Playground
Props
<InlineEdit value={name} onSave={…} label="Project name" placeholder="Add a name" />Examples
Rename
Editable page title
A headline inside an `h2`, capped at 40 characters.
States
defaultdisabledsize="title"size="sm"size="md"size="lg"size="headline"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| valuerequired | string | — | The saved text. |
| onSaverequired | (value: string) => void | Promise<unknown> | — | Called on Enter or blur when the text changed. A promise keeps the field open and busy; a rejection keeps it open and invalid. |
| labelrequired | string | — | Names the input, and the button reads "Edit ‹label›, ‹value›". |
| placeholder | string | — | Shown when the value is empty. |
| disabled | boolean | — | Shows the text without editing. |
| size | 'title' | 'sm' | 'md' | 'lg' | 'headline' | 'md' (or the `as` element's own type when `as` is set) | 11.5. Type role of the text and the input: body small, medium, large, title large or headline small. With as and no size, the text takes the wrapper’s type. |
| as | React.ElementType<any, keyof React.JSX.IntrinsicElements> | — | 11.5. Wraps the text, and the input while editing, in this element: a heading ("h2") or a component such as Sheet.Title or Dialog.Title, so the heading and the dialog’s name stay in place. |
| maxLength | number | — | 11.5. Caps the input and shows a "12/40" counter, announced near the limit. |
| className | string | — |
Accessibility
Keyboard
- Enter / Space
On the text: starts editing.
- Enter
In the input: saves.
- Escape
Reverts and returns focus to the text.
Notes
Moving focus away saves too. Validate in `onSave` and reject to keep the field open.
On iOS & Android: InlineEdit
@nexub/react-nativeAlpha
import { InlineEdit } from '@nexub/react-native';
<InlineEdit label="Project name" value={name} onSave={setName} />Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Saving | Enter or blur saves; Escape reverts. | Return or leaving the field saves. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
InlineEdit props
| Prop | Type | Default | Description |
|---|---|---|---|
| labelrequired | string | — | — |
| valuerequired | string | — | — |
| onSaverequired | (value: string) => void | — | Called on Return or when the field loses focus, if the text changed. |
| placeholder | string | — | — |
| disabled | boolean | false | The text can't be tapped to edit; screen readers hear it as dimmed. |
| maxLength | number | — | Caps the field's length and shows a "12/80" counter while editing. |
| size | 'sm' | 'md' | 'lg' | 'title' | 'headline' | 'lg' | Type role of the text, from body text up to a headline; the field grows to match. |
| style | StyleProp<ViewStyle> | — | — |