X Enterprises
Bulk Action

BulkActionExport

Export selected rows to CSV or JSON.

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

<XABulkActionExport />

Exports the selected rows to CSV (always available) or JSON (when enableJson is set). Shows a dropdown to choose format when JSON is enabled; otherwise renders a single button that triggers CSV download directly. Fires a toast notification on export and emits the export event with the format and file content.

<XABulkActionExport
  :selected="selectedRows"
  :columns="[
    { key: 'name', label: 'Name' },
    { key: 'email', label: 'Email' },
    { key: 'status', label: 'Status' },
  ]"
  filename="users-export"
  enable-json
/>

Props

PropTypeDefaultDescription
selectedunknown[]Required. Array of selected row data objects.
columnsExportColumn[]Required. Column definitions: { key, label, formatter? }.
filenamestring'export'File name without extension.
labelstring'Export'Button label text.
showLabelbooleantrueShow label text on the button.
enableJsonbooleanfalseAdd a JSON export option to a dropdown menu.
disabledbooleanfalseForce-disable the button regardless of selection.

Emits

EventPayloadDescription
export(format: 'csv' | 'json', content: string)Fired after a successful export with the generated file content.

AI Context

component: XABulkActionExport
package: "@xenterprises/nuxt-x-app"
category: BulkAction
use-when: >
  User has selected one or more rows in a data table and needs to export
  the selection. Place in the table toolbar alongside the selection checkbox.
  Automatically disabled when selected array is empty.
patterns:
  - Accepts a selected array and disables itself when it is empty
  - Pass columns with key/label (and optional formatter) for CSV column control
Copyright © 2026