Wrap a preview and an input in an area. A press, Enter, or a double click opens the field; Enter or a blur saves, Escape cancels.
report-title.tsx
Editable
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | — | The saved text (controlled). |
| default | string | "" | The saved text at mount. |
| on | — | Called with the new text after a save (after onSubmit resolves). | |
| on | — | Called on a save with the new text. Return a Promise for an async save: the field turns read-only and the Submit trigger spins; a reject keeps the field open with its message. | |
| on | — | Called when an edit ends with no save (Escape, Cancel, or an empty text). | |
| editing | boolean | — | Shows the field (controlled). |
| default | boolean | false | Shows the field at mount (a rename started from a menu). |
| on | — | ||
| activation | "click""dblclick""focus""none" | "click" | What opens the field: click (default; Enter, Space, or F2 on the focused preview too), dblclick (a list where a click selects; Enter and F2 still open it), focus, or none (only editing and the Edit trigger). |
| submit | "blur""both""enter""none" | "both" | What saves: both (default: Enter and a blur), enter, blur, or none. A blur that does not save cancels. |
| select | boolean | true | Selects the text when the field opens. Default true; else the caret goes to the end. |
| multiline | boolean | false | Many lines: Enter adds a line, Mod+Enter saves. Use EditableTextarea. |
| placeholder | string | — | The muted text of the preview when the text is empty. |
| disabled | boolean | false | |
| read | boolean | false | No edit; the text stays selectable. |
| invalid | boolean | false | The field shows the error look, and Enter and a blur do not save. |
| allow | boolean | false | Save an empty text. Default false: an empty text cancels. |
| size | "default""lg""sm" | "default" | |
| variant | "ghost""outline" | "ghost" | ghost (default): text with no edge at rest. outline: the field edge at rest, for a form. |
| rounded | "default""full" | "default" | |
| width | "fill""fit" | multiline ? "fill" : "fit" | fit: as wide as the text (default for one line). fill: the full row (default for many). |
| labels | — | ||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
EditableArea
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| indicator | boolean | true | The pencil hint after the box: a 24px slot that is always there, so the box keeps its place when the pencil fades in on hover or focus. No pencil on a touch screen. Default true; turn it off with the Edit trigger or in a table cell. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
EditablePreview
<button>| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Custom text in the preview. Default: the saved text, or the placeholder. |
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. |
EditableInput
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
EditableTextarea
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
EditableControls
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
EditableEditTrigger
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | — | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |||||
| children | ReactNode | — | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
EditableSubmitTrigger
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | — | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |||||
| children | ReactNode | — | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
EditableCancelTrigger
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| busy | boolean | — | The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading. | ||||
| spinner | "center""start" | — | center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label. | ||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| size | "default""icon""icon-lg""icon-sm""icon-xs""lg""sm""xl""xs" | — | |||||
| variant | "dashed""default""destructive""destructive-outline""ghost""link""media""outline""secondary" | — | |||||
| children | ReactNode | — | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
EditableError
<p>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <p> attributes | — | Every other attribute goes to the <p>, with a ref. |
| EnterorSpaceorF2 | On the preview: opens the field with the text selected. |
|---|---|
| Enter | In the field: saves. With multiline, adds a line. |
| ModEnter | With multiline: saves. |
| Escape | Puts the old text back and closes the field. |
Built with
Installs with Editable







