---
title: Action target
description: Submit a small action directly or through a dialog.
---

Use `submitTo` when an action needs only a button, a confirmation, or a small
fixed set of fields.

## API

```ts
submitTo(action, args?, presentation?)
  .withInitialData(values)
  .setDialog(dialog)
  .setFields(fields)
```

Pass the action definition directly. `submitTo` does not accept a thunk.
`args` must contain one defined value for each action parameter.

`presentation` can be a value or a callback. It supports `text`, `icon`,
`tooltip`, `skip`, `disabled`, `intent`, and `primary`.

- `skip: true` removes the complete action.
- `disabled: true` sends only a disabled control. Backlit does not resolve
  args, dialog data, or form data for it.

Missing args on an active action are an authoring error.

## Direct action

Do not set a dialog or fields. The renderer sends an empty payload when the
person selects the action. It does not mount an HTML form or create RHF state.

```ts
submitTo(archiveOrder, [order.id], { text: 'Archive' })
```

## Confirmation dialog

Use `setDialog` to ask for confirmation. A fieldless confirmation also sends
an empty payload and does not create RHF state.

```ts
submitTo(cancelOrder, [order.id], { text: 'Cancel order' }).setDialog({
  title: 'Cancel this order?',
  description: 'This action cannot be undone.',
  submitLabel: 'Cancel order',
})
```

## Dialog with fields

Call `setFields` after `setDialog`. The field list is stable. Each field can
use its normal configuration and can read the current row. Initial values use
the same input remapping as a regular form.

```ts
submitTo(changeStatus, [order.id], { text: 'Change status' })
  .withInitialData({ status: order.status })
  .setDialog({
    title: 'Change order status',
    submitLabel: 'Save status',
  })
  .setFields(orders.pick('status'))
```

The dialog mounts the regular form renderer only while it is open. This keeps
all RHF behavior in one place.

`submitTo` does not accept panels, sections, conditions, zones, or a dynamic
field list. For a full form, create a view with `form()` and open that view
with `visitTo` in `modal` or `drawer` mode.

## Intent and priority

Use `intent: 'destructive'` when the action removes data that cannot be restored.
Other actions use `neutral`. Intent describes the effect of an action.
Use `primary: true` to mark the main action. These values are presentation;
authorize and validate the operation on the server.

## Complete controls

<BacklitExample path="targets/controls" view="list" />
