---
url: "https://vueda.dev/v3/reference/api/js/use/useModelAction/functions/useModelAction.md"
title: "useModelAction"
---

# useModelAction

## Overview

Provides target, execution, copy, dry-run, and redirect plumbing for model actions.
It does not create or consume a form context; form shells layer `useActionForm`
or `ActionForm` on top when they need submit UI and validation summaries.

## Signature

`useModelAction(props)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-props">props</span> | `object` | yes | Reactive action configuration. |

#### props Properties

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="param-props-action">action</span> | `string` |  |  | Action identifier sent to the server. |
| <span id="param-props-actionErrorSummary">actionErrorSummary</span> | `string` |  |  | Toast summary shown when the action fails. |
| <span id="param-props-actionSuccessSummary">actionSuccessSummary</span> | `string` |  |  | Toast summary shown on successful action completion. |
| <span id="param-props-actionVerboseName">actionVerboseName</span> | `string` |  |  | Human-readable action name. |
| <span id="param-props-app">app</span> | `string` |  |  | Django app label that owns the model. |
| <span id="param-props-bannerDescription">bannerDescription</span> | `string` |  |  | Optional banner description. |
| <span id="param-props-bannerTitle">bannerTitle</span> | `string` |  |  | Optional banner title. |
| <span id="param-props-confirmMessage">confirmMessage</span> | `string` |  |  | Confirmation message shown to the user before submitting. |
| <span id="param-props-enableDryRun">enableDryRun</span> | `boolean` |  |  | Whether to perform dry-run validation. |
| <span id="param-props-fetchState">fetchState</span> | `object` |  |  | Selected-object fetch state. |
| <span id="param-props-instanceList">instanceList</span> | `object \| object` |  |  | List  instance that holds the selected objects. Bulk actions use it to reconcile displayed rows after a real destroy.  Omit it to use a private transport-only list. |
| <span id="param-props-model">model</span> | `string` |  |  | Django model name the action targets. |
| <span id="param-props-pk">pk</span> | `string \| number \| string[] \| number[]` |  |  | Optional primary key or primary keys when no fetch state is ready. |
| <span id="param-props-requestMethod">requestMethod</span> | `string` |  |  | HTTP method used for non-destroy action requests. |
| <span id="param-props-tone">tone</span> | `"neutral" \| "info" \| "warning" \| "success" \| "danger"` |  |  | Sentiment tone. |
| <span id="param-props-transformSubmitDataFn">transformSubmitDataFn</span> | `(values: any) => any` |  |  | Optional form-value transform. |

### Returns

[ModelActionContext](/v3/reference/api/js/use/useModelAction/types/ModelActionContext.md)

## Source

`client/lib/use/useModelAction.js:103`
