Inline edit
Plain text that turns into an input right where it is on click or Enter, its width morphing smoothly; Enter saves, Escape cancels, with saving and error states — friendly to wire:model.
Real scenarios
The component as it is used in a product — not a specimen grid.
Rename a project where it stands
Click the title (or Tab to it and press Enter): it becomes an input of exactly its own width, and the width springs as it changes. Enter saves into the Livewire state below, Escape puts the old title back.
Q3 growth roadmap
Settings rows
The store handle refuses anything with a space (the save shows its error and keeps the field open); the support email is plain.
- Store handle
-
- Support email
-
Right to left
A Persian list title: the input grows toward the left as you type.
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| label | string | '' | The field’s name for assistive tech (“Project name”). |
| wire:model | string | — | The saved value is entangled with the Livewire property (only after Enter, not on every key). |
| action | string | null | A Livewire method that receives the new value; return false or a message to show the error state. |
| required / placeholder | bool / string | false / null | Refuse an empty value; the text shown when there is none. |
| blur | string | 'save' | Leaving the field saves (save) or cancels (cancel). |
Snippet
<x-nx::inline-edit label="نام پروژه" wire:model="project.name" action="rename" required />