CnMassDeleteDialog
Two-phase mass delete confirmation dialog. Shows list of items to delete, requires confirmation, and displays results.
It is CnMassActionDialog with the delete texts, the error variant and a trash icon as defaults. Every prop of that dialog works here too.
Try it
Wraps: NcDialog, NcButton, NcNoteCard

Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | Array | [] | Items to delete ([\{ id, name \}]) |
nameField | String | 'title' | Field to display as item name |
nameFormatter | Function | null | Optional function (item) => string to format item names. Overrides nameField when provided. |
dialogTitle | String | 'Delete items' | |
warningText | String | '' | Warning text shown above the item list |
emptyText | String | 'No items selected for deletion.' | Message shown when all items have been removed from the list |
successText | String | 'Items successfully deleted.' | Message shown in the result phase on success |
cancelLabel | String | 'Cancel' | |
closeLabel | String | 'Close' | Label for the close button shown in the result phase |
confirmLabel | String | 'Delete' | |
removeLabel | String | 'Remove from list' | Tooltip/label for the per-item remove button |
variant | String | 'error' | Variant of the primary button |
confirmIcon | String or component | trash can | Icon on the primary button: a CnIcon name or an icon component |
sentence | String | 'Are you sure you want to permanently delete {count}?' | Board look: the question above the list, {count} is the bold item count |
irreversible | Boolean | true | Board look: end the sentence with "This action cannot be undone." |
Events
| Event | Payload | Description |
|---|---|---|
confirm | ids[] | Deletion confirmed |
close | — | Dialog closed |
Public Methods
| Method | Description |
|---|---|
setResult(\{ success?, error?, results? \}) | Set result per item |
Live demo
<template>
<div>
<button @click="open = true" style="padding: 6px 16px; border-radius: 4px; background: var(--color-primary-element); color: white; border: none; cursor: pointer;">Delete selected (2)</button>
<CnMassDeleteDialog
v-if="open"
ref="dlg"
:items="[{ id: 1, title: 'Report A' }, { id: 2, title: 'Report B' }]"
@confirm="onConfirm"
@close="open = false" />
</div>
</template>
<script>
export default {
data() { return { open: false } },
methods: {
async onConfirm(ids) {
await new Promise(r => setTimeout(r, 800))
this.$refs.dlg.setResult({ success: true })
},
},
}
</script>
Usage
<CnMassDeleteDialog
ref="massDeleteDialog"
:items="selectedItems"
@confirm="onMassDelete"
@close="showMassDelete = false" />
Custom name formatting
Use nameFormatter when items don't have a simple name field:
<CnMassDeleteDialog
:items="selectedAuditTrails"
:name-formatter="(item) => t('myapp', 'Audit Trail #{id}', { id: item.id })"
@confirm="onMassDelete"
@close="showMassDelete = false" />
Reference (auto-generated)
The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnMassDeleteDialog.vue and update automatically whenever the component changes.
OpenRegister reliance
none: this component does not touch OpenRegister, directly or through anything it imports. 0 direct references, 0 files reached through imports.
See the reliance overview for the filterable list.
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
confirmValue | string | '' | Value the user must type before the destructive button enables. Empty: no field. | |
confirmFieldLabel | string | () => t('nextcloud-vue', 'Type to confirm') | Label of the type-to-confirm field. | |
items | array | ✓ | — | Items the action applies to. Each must have an id property. |
nameField | string | 'title' | Property name used for display (e.g., 'title', 'name') | |
nameFormatter | func | null | Optional function to format the item name. Receives the item, returns a string. Overrides nameField when provided. | |
dialogTitle | string | () => t('nextcloud-vue', 'Delete items') | Dialog title | |
warningText | string | () => t('nextcloud-vue', 'The following items will be permanently deleted. Remove any items you want to keep.') | Warning text shown above the item list | |
emptyText | string | () => t('nextcloud-vue', 'No items selected for deletion.') | Text when all items removed from list | |
successText | string | () => t('nextcloud-vue', 'Items successfully deleted.') | Success message | |
cancelLabel | string | () => t('nextcloud-vue', 'Cancel') | Label for the cancel button (visible before the action runs). | |
closeLabel | string | () => t('nextcloud-vue', 'Close') | Label for the close button (visible after the action completes). | |
confirmLabel | string | () => t('nextcloud-vue', 'Delete') | Label for the primary confirm button that triggers the delete. | |
removeLabel | string | () => t('nextcloud-vue', 'Remove from list') | Aria label for the per-row "remove from list" icon button. | |
variant | string | 'error' | Visual variant of the primary button. | |
confirmIcon | union | () => markRaw(TrashCanOutline) | Icon on the primary button: a CnIcon name or an icon component. Defaults to a trash can. | |
sentence | string | () => t('nextcloud-vue', 'Are you sure you want to permanently delete \{count\}?') | Board look: the question above the list, with {count} where the bold item count goes. | |
irreversible | boolean | true | Board look: end the sentence with "This action cannot be undone." |
Events
| Name | Payload | Description |
|---|---|---|
close | — | Emitted when the dialog should close: cancel, close button, or 2 seconds after a success. |
confirm | — | Emitted when the user confirms the action. Payload: the ids of the items still on the list. |
Methods
| Name | Description |
|---|---|
setResult | Set the result of the action. Call this from the parent after the API call completes. |
Board look
The irreversible prop (default true) ends the board sentence with "This action cannot be undone."; set it to false for a delete that can be undone. confirmValue and confirmFieldLabel add type-to-confirm.