Skip to main content

Actions

An action is a control in a page header. Where a widget is what a user reads, an action is what a user does.

The action types​

typeWhat it does
handlerCalls a named handler in your app.
open-modalOpens a modal.
open-pageOpens another page.
navigateGoes to a route.
object-opRuns an operation on the record, for example a status change.
exportDownloads the data in a chosen format.
open-formOpens a form.
refreshRe-reads the current data.
api-callCalls an endpoint with a method and payload.
agentHands the work to an assistant with a skill and a prompt.
toggleFlips a boolean on the record.

Fields every action shares​

id, label, icon, variant, and description. label is what the user reads, so it takes the voice rules like any other string: start with a verb, say what happens.

Fields particular types need​

  • confirm puts a confirmation step in front of a destructive action.
  • api-call uses url, method, payload and params.
  • export uses formats, download and filename.
  • object-op uses op, values, register, schema and objectId.
  • toggle uses field, labelOn, labelOff, stateSource and writeUrl.
  • agent uses agent, skill, prompt and resultField.

After it runs​

successMessage and errorMessage are what the user is told. Say what happened, not that something happened.

refresh re-reads the data so the screen reflects the change. onSuccessRoute sends the user somewhere next, which is often the point of the action.

Showing an action only sometimes​

visibleWhen gates an action on state. An action a user cannot use is worse than an absent one, because they will click it.

Next: put secondary detail beside the content. See Sidebars.