Bulk actions
Select across pages, preview before-and-after changes, handle stale snapshots, and filter or retry run results.
Installation
Writes app/components/bulk-actions.tsx and adds @shopify/polaris-types@2.0.0 once authenticated.
API reference
pageRecordsRequiredreadonly BulkRecord[]Pass the visible page with stable record IDs and labels.- Required
criteria / criteriaLabelRequiredCriteria / stringCapture applied search and filters as JSON and describe them in plain language. Changing criteria clears selection.- Required
matchingCountnumberTotal matching records before exclusions, if known.OptionalresourceRequired{ singular: string; plural: string }Give singular and plural labels for counts, review scope, and run summaries.- Required
actionsRequiredreadonly [BulkActionDefinition<Criteria>, ...BulkActionDefinition<Criteria>[]]Supply one or more bulk actions with optional icon, description, confirmationText guardrail, prepareReview before/after samples, onAction execution, and optional onRetry recovery. Up to two render inline and extras overflow into More bulk actions.- Required
childrenRequired(controls: BulkControls) => ReactNodeRender toolbar in the table filters slot, selectPage in the primary table header, and selectRecord in each visible row.- Required
Run under Shopify App Home AppProvider. Point polarisUrl to the Polaris 2.0 runtime.
Select records with the header or row checkboxes, choose Add featured tag, Archive, or open More bulk actions to review before-and-after diffs, unchanged counts, and warnings before confirming.
Return { status: "stale", reason } from onAction when underlying records changed since prepareReview ran, or export BulkRunResults standalone for progress bars, All/Failed/Succeeded filters, collapsible details, and batch or single-row retry.