X Enterprises
Inline

InlineEdit

Click-to-edit text/number field that saves to an API endpoint via useXCrud.

Inline

The Inline category provides click-to-edit field components for detail views and data tables. Each component follows the same pattern: display mode (read-only with a subtle hover affordance) → edit mode → optimistic save via useXCrud → success/error indicator. All rollback on API failure.

Components

<XAInlineEdit />

Renders a value inline. On click, reveals a text input. On Enter or blur, sends a PATCH to the configured endpoint. Shows a spinner while saving, a green check on success, and a red error icon (with tooltip) on failure.

<XAInlineEdit
  v-model="contact.name"
  field="name"
  endpoint="/api/contacts"
  :entity-id="contact.id"
  type="text"
  placeholder="Enter name..."
  display-class="font-medium"
  @save="onSaved"
  @error="onError"
/>

Props

PropTypeDefaultDescription
modelValueString | NumbernullCurrent field value (v-model)
fieldStringrequiredField name to update in the API payload
endpointStringrequiredAPI endpoint passed to useXCrud
entityIdString | NumberrequiredRecord ID for the PATCH request
type'text' | 'number' | 'email' | 'tel' | 'url''text'Input type
placeholderString'Click to edit'Placeholder shown in display and edit modes
displayClassString''Additional CSS classes for the display span
inputClassString''Additional CSS classes for the input element
formatterFunctionnullOptional function to transform the display value

Emits

EventPayloadDescription
update:modelValueString | NumberOptimistic value update
savenewValue, previousValueSave succeeded
errorErrorSave failed

AI Context

component: XAInlineEdit
package: "@xenterprises/nuxt-x-app"
category: Inline
auto-import: true
use-when: >
  Detail/show pages where users should be able to edit individual text or
  number fields without navigating to a separate edit form.
key-patterns:
  - Requires field, endpoint, and entityId props
  - Uses useXCrud internally — no manual API call needed
  - Performs optimistic updates and reverts on failure
  - Use v-model to keep the parent state in sync
Copyright © 2026