X Enterprises
Inline

InlineSelect

Click-to-select dropdown that saves a field value change 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

<XAInlineSelect />

Displays the current option value (as a badge if the option has a color). On click, opens a USelectMenu. Saves immediately on selection change.

<XAInlineSelect
  v-model="task.status"
  field="status"
  endpoint="/api/tasks"
  :entity-id="task.id"
  :options="[
    { value: 'todo', label: 'To Do', color: 'neutral' },
    { value: 'in_progress', label: 'In Progress', color: 'warning' },
    { value: 'done', label: 'Done', color: 'success' },
  ]"
  value-key="value"
  label-key="label"
  placeholder="Select status..."
  @save="onStatusChanged"
/>

Props

PropTypeDefaultDescription
modelValueString | Number | BooleannullCurrent value (v-model)
fieldStringrequiredField name to update
endpointStringrequiredAPI endpoint for useXCrud
entityIdString | NumberrequiredRecord ID
optionsArrayrequiredOptions array (objects or primitives)
valueKeyString'value'Key used as the option value
labelKeyString'label'Key used as the display label
placeholderString'Select...'Placeholder text
displayClassString''Additional CSS classes for the display span
selectClassString''Additional CSS classes for the select menu

Emits

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

AI Context

component: XAInlineSelect
package: "@xenterprises/nuxt-x-app"
category: Inline
auto-import: true
use-when: >
  Detail pages where users should be able to change a status, category, or
  other select field inline. Shows a colored badge in display mode when
  options have a color key.
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
  - Shows colored badge in display mode when options have a color key
Copyright © 2026