Skip to content

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

NameTypeRequiredDefaultDescription
iconOverrideObjectnullA partial icon registry ({ [componentName]: { [iconName]: { component, props } } }) merged with inherited and default icon entries; scopes icon overrides to this component and its descendants.
themeOverrideString|Object|ArraynullA partial theme object merged with the component's default theme; accepts a class string, class array, or theme object.
appstringyesDjango app label that owns the model.
modelstringyesDjango model name the action targets.
actionstringyesAction identifier (e.g. "delete" or a custom action name) sent to the server.
pkstring|number|arrayundefinedPrimary key or primary keys used when selected objects have not been fetched yet.
actionVerboseNamestringundefinedHuman-readable action name shown in confirmation and result messages; defaults to a title-cased version of action.
actionSuccessSummarystringundefinedToast summary shown on successful action completion; auto-generated from the action and model name if omitted.
actionErrorSummarystringundefinedToast summary shown when the action fails; auto-generated from the action and model name if omitted.
confirmMessagestringundefinedConfirmation message shown to the user before submitting; auto-generated from the action and model name if omitted.
fetchStateobjectundefinedReactive fetch state object providing the list of selected objects and their data.
instanceListobjectundefinedreactive-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.
transformSubmitDataFnfuncundefinedOptional function to transform form values before they are sent in the request body.
requestMethodstring"PUT"HTTP method used for the action request (ignored for destroy actions, which always use DELETE).
enableDryRunbooleantrueWhen true, performs a dry-run validation request before the final submission.
tonestring"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.
bannerTitlestringundefinedOptional banner title; defaults to a sentence built from action + model name.
bannerDescriptionstringundefinedOptional banner description; defaults to "Review the selected records before continuing."
barebooleanfalseWhen 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.
confirmTextstringundefinedLiteral 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

NameScopedDescription
confirm-buttonyes
action-banneryesOverride the tone-tracked banner shown above the confirmation body. Only rendered when bare is false.
banner-metayes
selected-objectsyesOverride the list of selected objects shown above the confirmation form.
link-itemyesOverride the link rendered for each selected object in the default list.
confirm-messageOverride the confirmation prompt shown before submitting.
extra-fieldsyes
form-confirm-dialog-warningsyes
warning-entryyes

Full slot reference

Source

client/lib/views/ModelActionForm.vue

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2