TotalBase
Widgets

Display

Text, images, tables, badges and the other widgets that show the page's data.

In the admin: Design form › Widgets › Display

Widget
Heading, Texttitles and text, which can be formulas: Total: $ 1,540,000
Imagean image uploaded in the designer (a public file), a file of the record, or an https URL
Tablerows of a variable, with search, paging, computed columns, row colors and row actions
Badge, Alert, Progress, Separator, Icon, Avatar, User, Empty statesmall pieces of display
QR codedraws a value as a QR code, in the browser
Resulta large panel with an outcome at a glance, with a sound: a kiosk's Welcome or Denied

Image

An image uploaded in the designer is a public file: anyone with its address can see it. Use it for a logo or an illustration, never for private data.

TImage · TotalBase

An image - one uploaded here, a file of the record () or a URL; with its caption, an icon or a text when there's none, and Clicked to use it as a button.

Props

PropCodeTakes
ImagesrcƒA file's id or an https URL. Uploaded here, it's a public file - anyone who opens the page sees it. A formula: a file column of the record, .
Alternative textaltƒWhat it shows, for a screen reader - and if it can't load.
CaptioncaptionƒA line under it.
Shapeaspectoriginal, 1:1, 3:4, 4:3, 16:9; default originaloriginal keeps the image's own shape; a ratio frames it.
Fitfitcover, contain; default containIn a frame: contain shows all of it; cover fills it, cropping.
HeightheightIn pixels - unset: its width and shape decide.
Largest widthmaxWidthIn pixels - unset: the field's width.
Cornerscornersnone, sm, md, lg, xl, full; default mdHow round the image's corners are - full: a circle (or a pill). The Style tab's Radius rounds its box.
Icon when emptyemptyIconShown when there's no image - unset: a picture icon.
Text when emptyemptyTextƒA line beside that icon.

Events

EventCodeReceives
Clickedclick- the image clicked or tapped (it then reads as a button)

Heading

THeading · TotalBase

A section title.

Props

PropCodeTakes
Levellevelh1, h2, h3, h4, h5, h6

Also: Text label (ƒ).

Text

TText · TotalBase

A paragraph - its content can be a formula.

Props

Props: Text label (ƒ).

QR code

TQrCode · TotalBase

A QR code of a value - drawn in the browser, never sent anywhere: a device's pairing code, a link. Empty, it says so instead of an unreadable code.

Props

PropCodeTakes
ValuevalueƒWhat the code holds - a formula: , or a JSON or a URL with it.
SizesizeIts side in pixels (default 200).
Error correctionerrorCorrectionL, M, Q, HHow much of it may be lost and still read - L 7 %, M 15 % (default), Q 25 %, H 30 %; more makes it denser.
CaptioncaptionƒText under it - the code itself, to type it when it can't be scanned.
Download buttondownloadA button to save it as an SVG, or print it.

Result

TResult · TotalBase

A large panel for an outcome at a glance - a color, an icon, a title and a description, with a tone and a vibration - shown by the page's Code with dataview.controls..show({ color, icon, title, description, sound, resetAfter }); it goes back to its waiting state on its own after Reset after seconds. A kiosk's answer to a scan.

Height: rows of 40 px, or Fill height

Props

PropCodeTakes
Waiting titleidleTitleƒWhat it says while waiting for a result - unset: Ready.
Waiting descriptionidleDescriptionƒA line under it while waiting - e.g. Scan your code.
Waiting iconidleIconƒIts icon while waiting - unset: a scan frame.
Waiting coloridleColorƒ; default neutralIts color while waiting - one of the theme's colors.
Reset afterresetAfterƒ; default 5Seconds a result stays before it goes back to waiting - 0: until the next one or reset(). show({ resetAfter }) may change it for one result.
Variantvariantƒ; solid, outline, soft, subtle; default solidHow a result fills the panel: solid, outline, soft or subtle. Waiting, it is always soft.
Sizesizemd, lg, xl; default lgIts icon and text, from md to xl.
Soundsounddefault trueA tone with each result - a rising one for success, a low one for error and warning; show({ sound: "success" | "error" | false }) may choose.
Vibratevibratedefault trueA vibration with each result, where the device can - longer for an error.

Events

EventCodeReceives
Back to waitingreset- it shows its waiting state again (Reset after, or reset())

Methods

Called from Code as dataview.controls.<name>.<method>().

MethodCode
Showshow()Shows a result: show({ color, icon, title, description, sound, resetAfter })
Resetreset()Goes back to waiting at once

Example

{
  "widget": "TResult",
  "name": "result",
  "props": {
    "idleTitle": "Scan your card",
    "resetAfter": 5,
    "size": "xl"
  }
}

Table

Over a Resource of a table, a foreign key shows as its table's row presentation, as in a DataView grid, read under the viewer's own permissions.

UTable · Nuxt UI

Rows of a Resource - its columns are the Resource's fields.

Height: rows of 40 px, or Fill height · When placed: asks for its data source

Props

PropCodeTakes
ColumnscolumnSettingsEach column's title, format and look - what isn't set comes from its resource's column. In its Rows' order; a hidden one still comes with Row clicked's row.
Computed columnscomputedColumnsA formula per row - * - shown after its Rows' fields; its look in Columns. A total that must add up belongs in PostgreSQL.
Row colorrowColorKeyper optionTints each row - a field holding a palette color (red, green...), or a formula: ? "red" : "".
Row actionsactionsIcon buttons at the end of each row - Action clicked tells which by its Name; each may be off or hidden by a formula per row.
Sticky headerstickyThe column titles stay in view while scrolling.
SearchsearchA search box over its Rows' Resource - the server searches its text fields.
Full-width searchsearchBlockThe search box as wide as the table - in a modal or a sidebar.
PagerpagerPages through its Rows' Resource on the server - its limit is the page size; with Count the total, too.
LoadingloadingƒShows a spinner while something is busy.

Also: Rows data (a Resource), Empty text empty (ƒ).

Slots

SlotCode
Emptyemptyedited in its own canvas

Events

EventCodeReceives
Row clickedselect{ row }
Action clickedaction{ action, row } - action is the clicked button's Name
Search EntersearchEnter{ search, rows, row } - the rows its search found, row the first (null when none)

Example

{
  "widget": "UTable",
  "name": "unassigned",
  "height": 8,
  "props": {
    "search": true,
    "pager": true
  },
  "bindings": {
    "data": {
      "variable": "unassignedOrders"
    }
  },
  "emits": {
    "select": "onOrderSelect"
  }
}

Badge

UBadge · Nuxt UI

A short label.

Props

PropCodeTakes
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; solid, outline, soft, subtleIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
IconiconƒAn icon at its start.
SquaresquareAs wide as it is tall - for an icon alone.

Also: Label label (ƒ).

Alert

UAlert · Nuxt UI

A message with a title and a description.

Props

PropCodeTakes
IconiconƒAn icon at its start.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; solid, outline, soft, subtleIts style: filled, outlined, soft...
Orientationorientationhorizontal, verticalLaid out in a row or in a column.
Close buttoncloseAn ✕ in its corner that closes it.

Also: Title title (ƒ), Description description (ƒ).

Slots

SlotCode
Actionsactionsedited in place

Events

EventCodeReceives
Closedupdate:open{ open }

Separator

USeparator · Nuxt UI

A rule between sections, with an optional label.

Props

PropCodeTakes
IconiconƒAn icon at its start.
ColorcolorƒOne of the theme's colors - primary, error, success...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
Linetypesolid, dashed, dotted
Orientationorientationhorizontal, verticalLaid out in a row or in a column.

Also: Label label (ƒ).

Progress

UProgress · Nuxt UI

A progress bar.

Props

PropCodeTakes
Show the valuestatusShows the value as a number beside the bar.
ColorcolorƒOne of the theme's colors - primary, error, success...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
Orientationorientationhorizontal, verticalLaid out in a row or in a column.

Also: Value modelValue (ƒ), Max max (ƒ).

Avatar

UAvatar · Nuxt UI

An image, initials or an icon in a circle.

Props

PropCodeTakes
IconiconƒAn icon at its start.
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.

Also: Image src (ƒ), Alternative text alt (ƒ), Initials text (ƒ).

User

UUser · Nuxt UI

A name and a description beside an avatar.

Props

PropCodeTakes
ImageavatarƒIts avatar's image URL - empty shows the name's initials.
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
Orientationorientationhorizontal, verticalLaid out in a row or in a column.

Also: Name name (ƒ), Description description (ƒ).

Events

EventCodeReceives
Clickclick

Empty state

UEmpty · Nuxt UI

An icon, a title and a description for "nothing here yet".

Props

PropCodeTakes
IconiconƒAn icon at its start.
LoadingloadingƒShows a spinner while something is busy.
Variantvariantƒ; solid, outline, soft, subtle, nakedIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.

Also: Title title (ƒ), Description description (ƒ).

Slots

SlotCode
Actionsactionsedited in place

Icon

UIcon · Nuxt UI

A single icon.

Props

PropCodeTakes
IconnameƒThe icon to show.

Next steps

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