> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# Function: useTriggerAction()

> **useTriggerAction**(): (`userMessage`: `string`, `formName?`: `string`, `action?`: [`ActionPlan`](/next/api/genui/openui/core/interfaces/ActionPlan.md) | \{ `context?`: `string`; `params?`: `Record`\<`string`, `any`>; `type?`: `string`; `url?`: `string`; }) => `void` | `Promise`\<`void`>

Get the triggerAction function for firing structured action events.

## Returns

(`userMessage`: `string`, `formName?`: `string`, `action?`: [`ActionPlan`](/next/api/genui/openui/core/interfaces/ActionPlan.md) | \{ `context?`: `string`; `params?`: `Record`\<`string`, `any`>; `type?`: `string`; `url?`: `string`; }) => `void` | `Promise`\<`void`>

## Example

```tsx
const triggerAction = useTriggerAction();
<button onClick={() => triggerAction("Submit", "myForm")}>
```
