ModelActionForm
Overview
Wraps ActionForm to execute a named action (such as delete or a custom bulk operation) against one or more model instances. It displays the selected objects, a confirmation message, and handles submission, dry-run validation, and post-action redirect to the appropriate list or detail view.
Renders a tone-tracked confirmation card with a banner, a selected-objects chip-row panel, and a confirm-prompt panel. The bare prop suppresses the card chrome and banner so a parent view (such as ViewDestroy) can wrap the form in its own toned card.
Theme entry: ModelActionForm
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| iconOverride | Object | null | A partial icon registry ({ [componentName]: { [iconName]: { component, props } } }) merged with inherited and default icon entries; scopes icon overrides to this component and its descendants. | |
| themeOverride | String|Object|Array | null | A partial theme object merged with the component's default theme; accepts a class string, class array, or theme object. | |
| app | string | yes | Django app label that owns the model. | |
| model | string | yes | Django model name the action targets. | |
| action | string | yes | Action identifier (e.g. "delete" or a custom action name) sent to the server. | |
| pk | string|number|array | undefined | Primary key or primary keys used when selected objects have not been fetched yet. | |
| actionVerboseName | string | undefined | Human-readable action name shown in confirmation and result messages; defaults to a title-cased version of action. | |
| actionSuccessSummary | string | undefined | Toast summary shown on successful action completion; auto-generated from the action and model name if omitted. | |
| actionErrorSummary | string | undefined | Toast summary shown when the action fails; auto-generated from the action and model name if omitted. | |
| confirmMessage | string | undefined | Confirmation message shown to the user before submitting; auto-generated from the action and model name if omitted. | |
| fetchState | object | undefined | Reactive fetch state object providing the list of selected objects and their data. | |
| instanceList | object | undefined | reactive-helpers list instance holding the selected objects. Bulk actions use it so a real destroy reconciles the rows the caller is showing. Omit it to use a private transport-only list. | |
| transformSubmitDataFn | func | undefined | Optional function to transform form values before they are sent in the request body. | |
| requestMethod | string | "PUT" | HTTP method used for the action request (ignored for destroy actions, which always use DELETE). | |
| enableDryRun | boolean | true | When true, performs a dry-run validation request before the final submission. | |
| tone | string | "info" | Sentiment tone that drives the banner and card accents. One of info (default confirmations), success (activate / restore), warning (irreversible non-destructive), or danger (destructive). Routed via data-tone on the card root and consumed by Tailwind v4 group-data-[tone=…]/model-action-form: variants. | |
| bannerTitle | string | undefined | Optional banner title; defaults to a sentence built from action + model name. | |
| bannerDescription | string | undefined | Optional banner description; defaults to "Review the selected records before continuing." | |
| bare | boolean | false | When true, suppress the card chrome and tone-tracked banner. Used by parent views (such as ViewDestroy) that wrap the form in their own toned card. | |
| confirmText | string | undefined | Literal phrase the operator must type before the confirm button enables. When set, a TypedConfirmField renders inside the body (after any extra-fields slot content) and the submit button is gated until the typed value matches. Leave undefined to skip the type-to-confirm gate. |
Slots
| Name | Scoped | Description |
|---|---|---|
confirm-button | yes | |
action-banner | yes | Override the tone-tracked banner shown above the confirmation body. Only rendered when bare is false. |
banner-meta | yes | |
selected-objects | yes | Override the list of selected objects shown above the confirmation form. |
link-item | yes | Override the link rendered for each selected object in the default list. |
confirm-message | Override the confirmation prompt shown before submitting. | |
extra-fields | yes | |
form-confirm-dialog-warnings | yes | |
warning-entry | yes |
Source
client/lib/views/ModelActionForm.vue