You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return { ok: true, successMessage: `Sent to ${selectedIds.length} users` };
134
+
},
135
+
},
136
+
],
137
+
},
138
+
}
139
+
```
140
+
141
+
### Confirmation dialog
142
+
143
+
Pass `confirm` to show a dialog before the action runs.
144
+
145
+
**String** — shown as the dialog title, no secondary message:
146
+
147
+
```ts
148
+
confirm: 'Are you sure you want to send invitation emails?',
149
+
```
150
+
151
+
**Object** — full control over the dialog. `{count}` in `message` is replaced with the number of selected records; `|` separates singular and plural forms:
152
+
153
+
```ts
154
+
confirm: {
155
+
title: 'Are you sure you want to archive the selected items?',
156
+
message: 'Archiving {count} item. This process is irreversible. | Archiving {count} items. This process is irreversible.',
157
+
yes: 'Archive',
158
+
no: 'Cancel',
159
+
},
160
+
```
161
+
162
+
Omit `confirm` entirely to skip the dialog and run the action immediately.
163
+
164
+
### Fields
165
+
166
+
| Field | Type | Description |
167
+
|---|---|---|
168
+
|`label`|`string`| Button label shown in the list toolbar. |
169
+
|`icon`|`string`| Flowbite icon for the button. |
170
+
|`confirm`|`string \| { title?, message?, yes?, no? }`| Confirmation dialog. String → title only. Object → full control. If omitted, no dialog is shown. |
171
+
|`successMessage`|`string`| Toast message shown after the action completes. |
172
+
|`allowed`|`async ({ adminUser, selectedIds, allowedActions }) => boolean`| Called on page load (no `selectedIds`) to decide visibility, and again on click (with `selectedIds`) to authorize. |
173
+
|`action`|`async ({ selectedIds, adminUser, resource, tr }) => { ok, error?, successMessage? }`| Handler called with all selected IDs at once. |
174
+
|`showInThreeDotsDropdown`|`boolean`| Show in the three-dots menu of the list header instead of as a top-level button. |
175
+
117
176
### Access Control
118
177
119
178
You can control who can use an action through the `allowed` function. This function receives:
message: t('Deleting {count} item. This process is irreversible. | Deleting {count} items. This process is irreversible.',{count: checkboxes.value.length}),
0 commit comments