X Enterprises
Bulk Action

BulkActionStatus

Change the status of selected rows via a dropdown.

Bulk Action

Bulk action components sit in a table toolbar and operate on an array of selected rows. Each component is disabled when no rows are selected and emits success/error events so the parent can refresh data and clear the selection.

Components

<XABulkActionStatus />

Renders a neutral dropdown listing available statuses. Selecting one sends a PATCH with { [statusField]: value } for each selected item ID.

<XABulkActionStatus
  :selected="selectedRows"
  endpoint="api/orders"
  :statuses="[
    { value: 'active', label: 'Active', icon: 'i-lucide-check' },
    { value: 'archived', label: 'Archived', icon: 'i-lucide-archive' },
  ]"
  item-name="orders"
  :on-success="() => refresh()"
/>

Props

PropTypeDefaultDescription
selectedunknown[]Required. Array of selected row data objects.
endpointstringRequired. API endpoint path (no leading slash).
statusesStatusOption[]Required. Status options: { value, label, icon?, color? }.
idKeystring'id'Key used to extract the ID from each item.
statusFieldstring'status'Payload field name for the status value.
labelstring'Status'Button label text.
showLabelbooleantrueShow label text on the button.
itemNamestring'items'Noun used in toast messages.
disabledbooleanfalseForce-disable the button.
onSuccess() => void | Promise<void>Callback invoked after a successful update.
clearSelection() => voidCallback to clear the parent selection state.

Emits

EventPayloadDescription
success(ids: (string | number)[], status: string)Fired after all status updates succeed.
error(error: unknown)Fired if any PATCH request fails.

AI Context

component: XABulkActionStatus
package: "@xenterprises/nuxt-x-app"
category: BulkAction
use-when: >
  User has selected one or more rows in a data table and needs to change
  their status. Place in the table toolbar alongside the selection checkbox.
patterns:
  - Accepts a selected array and disables itself when it is empty
  - Uses inline dropdown — no confirmation modal
  - Pass onSuccess and clearSelection callbacks to refresh data after update
  - API calls use config.public.x.app.apiUrl as the base URL
Copyright © 2026