X Enterprises
Bulk Action

BulkActionDelete

Delete selected rows with confirmation modal.

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

<XABulkActionDelete />

Renders a red "Delete" button. On click, opens a XAModalConfirm dialog. On confirmation, sends DELETE requests to endpoint for each selected item ID and emits success or error.

<XABulkActionDelete
  :selected="selectedRows"
  endpoint="api/users"
  item-name="users"
  :on-success="() => refresh()"
  :clear-selection="() => (selectedRows = [])"
/>

Props

PropTypeDefaultDescription
selectedunknown[]Required. Array of selected row data objects.
endpointstringRequired. API endpoint path (no leading slash).
idKeystring'id'Key used to extract the ID from each item.
labelstring'Delete'Button label text.
showLabelbooleantrueShow label text on the button.
titlestring'Delete Items'Confirmation modal title.
messagestringOverride the auto-generated confirmation message.
itemNamestring'items'Noun used in the auto-generated confirmation message.
confirmTextstring'Delete'Confirm button label.
cancelTextstring'Cancel'Cancel button label.
disabledbooleanfalseForce-disable the button.
onSuccess() => void | Promise<void>Callback invoked after a successful delete.
clearSelection() => voidCallback to clear the parent selection state.

Emits

EventPayloadDescription
success(ids: (string | number)[])Fired after all deletes succeed.
error(error: unknown)Fired if any delete request fails.
cancelFired when the user cancels the confirmation modal.

AI Context

component: XABulkActionDelete
package: "@xenterprises/nuxt-x-app"
category: BulkAction
use-when: >
  User has selected one or more rows in a data table and needs to delete
  the selection. Uses a confirmation modal before deleting. Place in the
  table toolbar alongside the selection checkbox.
patterns:
  - Accepts a selected array and disables itself when it is empty
  - Uses XAModalConfirm for confirmation before sending DELETE requests
  - Pass onSuccess and clearSelection callbacks to refresh data after deletion
  - API calls use config.public.x.app.apiUrl as the base URL
Copyright © 2026