TotalBase
Widgets

Actions

The Button, and how a page tells the user what happened.

In the admin: Design form › Widgets › Actions

A Button runs a function of the Code on click.

Messages (Saved, Could not save) aren't widgets: Code shows them with dataview.notify.

Button

UButton · Nuxt UI

Runs a Code function on click.

Props

PropCodeTakes
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; solid, outline, soft, subtle, ghost, linkIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
IconiconƒAn icon at its start.
Trailing icontrailingIconƒAn icon at its end.
Typetypebutton, submit, resetSubmit sends the form it is in.
SquaresquareAs wide as it is tall - for an icon alone.
Full widthblockFills the width of its container.
LoadingloadingƒShows a spinner while something is busy.
DisableddisabledƒShown greyed out - it can't be used.

Also: Label label (ƒ).

Events

EventCodeReceives
Clickclick

Example

{
  "widget": "UButton",
  "name": "assign",
  "props": {
    "label": "Assign",
    "icon": "i-lucide-user-check",
    "color": "primary"
  },
  "bindings": {
    "loading": {
      "formula": "{{vars.assign.status}} == \"pending\""
    }
  },
  "emits": {
    "click": "onAssignClick"
  }
}

Next steps

  • Widgets: how a widget works, and every one of them.
  • Variables: what widgets show and change.