Editable
stableInline-editable text that swaps between preview and input.
Basic usage
Click to edit
Examples
Inline title editing
Use Editable for a task or document title that the user can rename in place.
Untitled document
Click to rename
Inline editing states
Editable swaps preview and input surfaces for titles, labels and metadata.
Q2 growth report
Click to rename
Features
- Click to edit.
- Enter / blur submit modes.
Installation
bash
pnpm dlx structyl add editableAPI Reference
Editable.Root
Inline-editable text.
| Prop | Type | Default |
|---|---|---|
| value | stringControlled value. | — |
| onValueChange | (value: string) => voidCalled when committed. | — |
| submitMode | 'enter' | 'blur' | 'both'How edits are committed. | 'both' |
| onSubmit | (value: string) => voidCalled on commit. | — |
Editable.Preview
The read-only display.
| Prop | Type | Default |
|---|
Editable.Input
The edit field.
| Prop | Type | Default |
|---|