X Enterprises
Table

TableEditableCell

Double-click-to-edit table cell with text, number, textarea, select, and boolean input modes.

TableEditableCell

A self-managing editable table cell. Renders a display value with a pencil hint on hover, switches into an editor on double-click, and emits save when the user commits the change (Enter or blur) or cancel (Escape). Pairs well with useXCrud for inline edits that persist immediately.

Components

<XATableEditableCell />

<XATableEditableCell
  :value="row.name"
  type="text"
  @save="(newValue, oldValue) => updateName(row, newValue)"
  @cancel="onCancelEdit"
>
  <span class="font-medium">{{ row.name }}</span>
</XATableEditableCell>
<XATableEditableCell
  :value="row.status"
  type="select"
  :options="[
    { label: 'Active',   value: 'active' },
    { label: 'Inactive', value: 'inactive' },
  ]"
  @save="(v) => updateStatus(row, v)"
/>

Props

PropTypeDefaultDescription
valuestring | number | boolean | object | arraynullCurrent cell value (also seeds the editor).
editablebooleantrueWhen false, the cell is read-only — no double-click edit.
type'text' | 'email' | 'number' | 'textarea' | 'select' | 'boolean''text'Editor type to render.
optionsArray[]Options for type="select". Passed through to USelect.
displayClassstring''Extra CSS classes applied to the display text.
formatterFunction | nullnullOptional (value) => string formatter for the display value.

Emits

EventPayloadDescription
save(newValue, oldValue)Fired after a successful edit (Enter or blur). Not fired if the value did not change.
cancel()Fired on Escape — value is reverted.

Slots

SlotDescription
defaultOverride the default display rendering. The pencil icon and edit-on-double-click behavior still apply.

Exposed methods

The component exposes the following via defineExpose so a parent can imperatively start / cancel edits:

MethodDescription
startEditing()Switch into edit mode and focus the input.
cancelEdit()Revert and exit edit mode.
isEditingReactive ref<boolean> indicating the current mode.

AI Context

component: XATableEditableCell
package: "@xenterprises/nuxt-x-app"
category: Table
use-when: >
  Tables where users need to tweak a single field without opening a full edit
  modal. Pair with useXCrud('resource').all() and its update() in the @save
  handler to persist immediately. Use XAInlineEdit for non-table contexts (cards, lists).
auto-save-trigger: "Enter or blur (after 100ms)"
cancel-trigger: "Escape"
Copyright © 2026