TotalBase
Widgets

Inputs

Every input: text, numbers, dates, choices, files, maps and the device's camera, position and signature.

In the admin: Design form › Widgets › Inputs

WidgetFor
Input, Textarea, Rich texttext; Rich text for formatted text
Number, Slider, Ratingnumbers
Date, Time, Rangedates, times and PostgreSQL ranges (daterange, numrange…)
Switch, Checkboxtrue or false
Select, Select menu, Autocomplete, Radio group, Listbox, Checkbox groupchoosing among options: a CHECK list's values, or rows of another table
Tags, PIN input, Color, JSONarrays, codes, a palette color, a jsonb value
File uploada file, stored in Files
Map (Leaflet)a point on a map
Location, Camera, Signature, Scannerthe device itself

When a column is placed, its input is chosen from its type and constraints: a CHECK list a select, a foreign key a Select menu over the referenced table, a boolean a switch, a point a map. A column only offers the inputs that can edit its kind of value.

The inputs that use the device's camera and position need HTTPS (or localhost): without it, the browser refuses them and the widget says why. The Camera and the Scanner then offer to use a photo instead.

Input

UInput · Nuxt UI

A single-line text field.

Edits: text, number, date, time, timestamp columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Typetypetext, email, password, tel, url, search, number, date, time, datetime-local, month, week, colorThe browser's own input for it - datetime-local shows a timestamp with time zone in the viewer's.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; outline, soft, subtle, ghost, noneIts 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.
DisableddisabledƒShown greyed out - it can't be used.
HighlighthighlightƒOutlined in its color, to draw attention.

Events

EventCodeReceives
Value changedupdate:modelValue{ value }
Changechange{ value }
Blurblur{ value }

Methods

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

MethodCode
Focusfocus()Puts the cursor in it

Textarea

UTextarea · Nuxt UI

Multi-line text.

Edits: text, JSON columns · A form field's input · Height: rows of 40 px, or Fill height

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Grow with its textautoresizeGets taller as the text grows, instead of scrolling.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; outline, soft, subtle, ghost, noneIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
IconiconƒAn icon at its start.
DisableddisabledƒShown greyed out - it can't be used.
HighlighthighlightƒOutlined in its color, to draw attention.

Also: Rows rows, Max rows maxrows.

Events

EventCodeReceives
Value changedupdate:modelValue{ value }
Changechange{ value }
Blurblur{ value }

Methods

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

MethodCode
Focusfocus()Puts the cursor in it

Number

UInputNumber · Nuxt UI

A number, with increment and decrement buttons.

Edits: number columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Orientationorientationhorizontal, verticalLaid out in a row or in a column.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; outline, soft, subtle, ghost, noneIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
DisableddisabledƒShown greyed out - it can't be used.
HighlighthighlightƒOutlined in its color, to draw attention.

Also: Min min (ƒ), Max max (ƒ), Step step.

Events

EventCodeReceives
Value changedupdate:modelValue{ value }
Changechange{ value }
Blurblur{ value }

Methods

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

MethodCode
Focusfocus()Puts the cursor in it

Date

UInputDate · Nuxt UI

A date, a date and time, or a date range.

Edits: date, timestamp, date range columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Date rangerangePicks a start and an end date.
Precisiongranularityday, hour, minute, secondA timestamp's: to the minute when unset. A date column is always to the day.
Calendarcalendardefault trueA calendar button beside the field - its days stop at the column's CHECK bounds; a timestamp's time below it. Typing stays.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; outline, soft, subtle, ghost, noneIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
IconiconƒAn icon at its start.
DisableddisabledƒShown greyed out - it can't be used.
HighlighthighlightƒOutlined in its color, to draw attention.

Events

EventCodeReceives
Value changedupdate:modelValue{ value }
Changechange{ value }
Blurblur{ value }
Focusfocus{ value }

Methods

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

MethodCode
Focusfocus()Puts the cursor in it

Time

UInputTime · Nuxt UI

A time of day, or a time range.

Edits: time, time range columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Time rangerangePicks a start and an end time.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; outline, soft, subtle, ghost, noneIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
IconiconƒAn icon at its start.
DisableddisabledƒShown greyed out - it can't be used.
HighlighthighlightƒOutlined in its color, to draw attention.

Events

EventCodeReceives
Value changedupdate:modelValue{ value }
Changechange{ value }
Blurblur{ value }
Focusfocus{ value }

Methods

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

MethodCode
Focusfocus()Puts the cursor in it

Switch

USwitch · Nuxt UI

An on/off value.

Edits: boolean columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
ColorcolorƒOne of the theme's colors - primary, error, success...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
LoadingloadingƒShows a spinner while something is busy.
DisableddisabledƒShown greyed out - it can't be used.

Also: Label label (ƒ), Description description (ƒ).

Events

EventCodeReceives
Changechange{ value }

Checkbox

UCheckbox · Nuxt UI

A yes/no value.

Edits: boolean columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; list, cardIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
DisableddisabledƒShown greyed out - it can't be used.

Also: Label label (ƒ), Description description (ƒ).

Events

EventCodeReceives
Changechange{ value }

Select

USelect · Nuxt UI

Pick from a short list - no search.

Edits: text, foreign key columns · A form field's input · When placed: asks for its data source

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Value fieldvalueKeyThe field of each option that is stored - its primary key by default.
Label fieldlabelKeyper optionThe field shown for each option - or a formula over its fields, e.g. + " - " + ; its Resource must read them.
Description fielddescriptionKeyper optionShown muted beneath the label - a field, or a formula over its fields.
Icon fieldiconKeyper optionEach option's icon, e.g. i-lucide-banknote - a field, or a formula over its fields.
Disabled fielddisabledKeyper optionTurns an option off - a true/false field, or a formula over its fields and the page: docs/06.dataviews/06.design-form/02.widgets/03.inputs.md == 5 && !.
MultiplemultiplePicks several options - its value is a list.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; outline, soft, subtle, ghost, noneIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
IconiconƒAn icon at its start.
DisableddisabledƒShown greyed out - it can't be used.
HighlighthighlightƒOutlined in its color, to draw attention.

Also: Options items (a Resource).

Events

EventCodeReceives
Value changedupdate:modelValue{ value, item } - item is the chosen option's whole row
Changechange{ value }
Blurblur{ value }
Focusfocus{ value }

Methods

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

MethodCode
Focusfocus()Puts the cursor in it

Select menu

Over another table's rows (a work order's site), a Select menu holds one page of them and searches the server as you type, so it works with thousands of rows. In the inspector's Search section:

  • Create from search: typing a value that isn't listed offers Create "…", which creates the row in the other table, as the user and under their permission to create there, and picks it.
  • Search window: a 🔍 beside the select opens the rows as a searchable, paged table, for long lists.

USelectMenu · Nuxt UI

Pick from a list, with search.

Edits: text, foreign key columns · A form field's input · When placed: asks for its data source

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Value fieldvalueKeyThe field of each option that is stored - its primary key by default.
Label fieldlabelKeyper optionThe field shown for each option - or a formula over its fields, e.g. + " - " + ; its Resource must read them.
Description fielddescriptionKeyper optionShown muted beneath the label - a field, or a formula over its fields.
Icon fieldiconKeyper optionEach option's icon, e.g. i-lucide-banknote - a field, or a formula over its fields.
Disabled fielddisabledKeyper optionTurns an option off - a true/false field, or a formula over its fields and the page: docs/06.dataviews/06.design-form/02.widgets/03.inputs.md == 5 && !.
MultiplemultiplePicks several options - its value is a list.
Clear buttonclearAn ✕ that empties the value.
Create from searchcreateItemOptions from a Resource: typing a value it doesn't list offers Create - a new row of its table with that value in its Label field, saved as the viewer (their CREATE permission), then picked. PostgreSQL decides whether the row is valid.
Search windowsearchWindowOptions from a Resource: a 🔍 beside it opens them as a table - its Resource's fields as columns, searched and paged on the server - to pick one by any of them. For long lists.
Search window assearchWindowAssidebar, modalWhere the search window opens - a sidebar (the default, room for a long list) or a modal. Full screen on a phone.
Search window sizesearchWindowSizesm, md, lg, xlIts width - unset, Nuxt UI's own (a narrow sidebar or modal); sm to xl as a record form's sizes, xl for a wide table. Full screen on a phone from md.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; outline, soft, subtle, ghost, noneIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
IconiconƒAn icon at its start.
DisableddisabledƒShown greyed out - it can't be used.
HighlighthighlightƒOutlined in its color, to draw attention.

Also: Options items (a Resource).

Events

EventCodeReceives
Value changedupdate:modelValue{ value, item } - item is the chosen option's whole row
Changechange{ value }
Blurblur{ value }
Focusfocus{ value }
Clearedclear
Row createdcreate{ item } - the row created from the search

Methods

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

MethodCode
Focusfocus()Puts the cursor in it

Example

{
  "widget": "USelectMenu",
  "name": "technician",
  "props": {
    "valueKey": "id",
    "labelKey": "user.name",
    "searchWindow": true
  },
  "bindings": {
    "modelValue": {
      "variable": "technician"
    },
    "items": {
      "variable": "freeTechnicians"
    }
  },
  "emits": {
    "change": "onTechnicianChange"
  }
}

Autocomplete

UInputMenu · Nuxt UI

Type to find an option.

Edits: text columns · A form field's input · When placed: asks for its data source

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Value fieldvalueKeyThe field of each option that is stored - its primary key by default.
Label fieldlabelKeyper optionThe field shown for each option - or a formula over its fields, e.g. + " - " + ; its Resource must read them.
Description fielddescriptionKeyper optionShown muted beneath the label - a field, or a formula over its fields.
Icon fieldiconKeyper optionEach option's icon, e.g. i-lucide-banknote - a field, or a formula over its fields.
Disabled fielddisabledKeyper optionTurns an option off - a true/false field, or a formula over its fields and the page: docs/06.dataviews/06.design-form/02.widgets/03.inputs.md == 5 && !.
MultiplemultiplePicks several options - its value is a list.
Clear buttonclearAn ✕ that empties the value.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; outline, soft, subtle, ghost, noneIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
IconiconƒAn icon at its start.
DisableddisabledƒShown greyed out - it can't be used.
HighlighthighlightƒOutlined in its color, to draw attention.

Also: Options items (a Resource).

Events

EventCodeReceives
Value changedupdate:modelValue{ value, item } - item is the chosen option's whole row
Changechange{ value }
Blurblur{ value }
Focusfocus{ value }
Clearedclear

Methods

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

MethodCode
Focusfocus()Puts the cursor in it

Radio group

URadioGroup · Nuxt UI

Pick one of a few options, all visible.

Edits: text columns · A form field's input · When placed: asks for its data source

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Value fieldvalueKeyThe field of each option that is stored - its primary key by default.
Label fieldlabelKeyper optionThe field shown for each option - or a formula over its fields, e.g. + " - " + ; its Resource must read them.
Description fielddescriptionKeyper optionShown muted beneath the label - a field, or a formula over its fields.
Icon fieldiconKeyper optionEach option's icon, e.g. i-lucide-banknote - a field, or a formula over its fields. Shown above its label when Indicator is hidden.
Color fieldcolorKeyper optionEach option's icon color, one of the theme's (primary, success, warning...) - a field, or a formula: < 0 ? "error" : "success".
Disabled fielddisabledKeyper optionTurns an option off - a true/false field, or a formula over its fields and the page: docs/06.dataviews/06.design-form/02.widgets/03.inputs.md == 5 && !.
Icon sizeiconSizesm, md, lg, xl, 2xlEach option's icon - from sm to 2xl; empty keeps Nuxt UI's.
Orientationorientationhorizontal, verticalLaid out in a row or in a column.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; list, card, tableIts style: filled, outlined, soft...
Indicatorindicatorstart, end, hiddenWhere its dot sits - hidden shows each option's icon instead, as cards do.
Columnscolumns1, 2, 3, 4, 5, 6Options per row - the rest wrap below. Two per row on a phone.
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
DisableddisabledƒShown greyed out - it can't be used.

Also: Options items (a Resource), Legend legend (ƒ).

Events

EventCodeReceives
Changechange{ value, item }

Tags

UInputTags · Nuxt UI

A free-form list of short text values.

Edits: array columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; outline, soft, subtle, ghost, noneIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
IconiconƒAn icon at its start.
DisableddisabledƒShown greyed out - it can't be used.
HighlighthighlightƒOutlined in its color, to draw attention.

Also: Max length maxLength.

Events

EventCodeReceives
Value changedupdate:modelValue{ value }
Changechange{ value }
Blurblur{ value }
Focusfocus{ value }

Methods

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

MethodCode
Focusfocus()Puts the cursor in it

Checkbox group

UCheckboxGroup · Nuxt UI

Pick any number of options, all visible.

Edits: array columns · A form field's input · When placed: asks for its data source

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Value fieldvalueKeyThe field of each option that is stored - its primary key by default.
Label fieldlabelKeyper optionThe field shown for each option - or a formula over its fields, e.g. + " - " + ; its Resource must read them.
Description fielddescriptionKeyper optionShown muted beneath the label - a field, or a formula over its fields.
Disabled fielddisabledKeyper optionTurns an option off - a true/false field, or a formula over its fields and the page: docs/06.dataviews/06.design-form/02.widgets/03.inputs.md == 5 && !.
Orientationorientationhorizontal, verticalLaid out in a row or in a column.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; list, card, tableIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
DisableddisabledƒShown greyed out - it can't be used.

Also: Options items (a Resource), Legend legend (ƒ).

Events

EventCodeReceives
Value changedupdate:modelValue{ value }
Changechange{ value }

Listbox

UListbox · Nuxt UI

A visible, filterable list to pick from.

Edits: text columns · A form field's input · When placed: asks for its data source

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Value fieldvalueKeyThe field of each option that is stored - its primary key by default.
Label fieldlabelKeyper optionThe field shown for each option - or a formula over its fields, e.g. + " - " + ; its Resource must read them.
Description fielddescriptionKeyper optionShown muted beneath the label - a field, or a formula over its fields.
Icon fieldiconKeyper optionEach option's icon, e.g. i-lucide-banknote - a field, or a formula over its fields.
Disabled fielddisabledKeyper optionTurns an option off - a true/false field, or a formula over its fields and the page: docs/06.dataviews/06.design-form/02.widgets/03.inputs.md == 5 && !.
MultiplemultiplePicks several options - its value is a list.
Filter boxfilterA search box above the options.
ColorcolorƒOne of the theme's colors - primary, error, success...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
LoadingloadingƒShows a spinner while something is busy.
DisableddisabledƒShown greyed out - it can't be used.
HighlighthighlightƒOutlined in its color, to draw attention.

Also: Options items (a Resource).

Events

EventCodeReceives
Value changedupdate:modelValue{ value, item }
Changechange{ value }

PIN input

UPinInput · Nuxt UI

A short code with a fixed number of characters.

Edits: text columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Typetypetext, number
MaskmaskHides what is typed, like a password.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; outline, soft, subtle, ghost, noneIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
DisableddisabledƒShown greyed out - it can't be used.
HighlighthighlightƒOutlined in its color, to draw attention.

Also: Length length.

Events

EventCodeReceives
Value changedupdate:modelValue{ value }
Changechange{ value }
Blurblur{ value }
Completedcomplete{ value }

Slider

USlider · Nuxt UI

A number picked along a bounded range.

Edits: number columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
TooltiptooltipShows the value above the handle while dragging.
Orientationorientationhorizontal, verticalLaid out in a row or in a column.
ColorcolorƒOne of the theme's colors - primary, error, success...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
DisableddisabledƒShown greyed out - it can't be used.

Also: Min min (ƒ), Max max (ƒ), Step step.

Events

EventCodeReceives
Value changedupdate:modelValue{ value }
Changechange{ value }

Rating

UInputRating · Nuxt UI

A star rating out of a fixed maximum.

Edits: number columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
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.
DisableddisabledƒShown greyed out - it can't be used.

Also: Stars length, Read only readonly (ƒ).

Events

EventCodeReceives
Value changedupdate:modelValue{ value }
Changechange{ value }

File upload

UFileUpload · Nuxt UI

A single uploaded file or image.

Edits: file columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
LabellabelƒThe empty field's text - the area's, or the button variant's. Unset: Drop a file here or click to browse.
DescriptiondescriptionƒA line under the area's text.
ButtonbuttonLabelƒThe area variant: a button under its text (Upload file), for whoever doesn't know the area can be tapped.
Accepted typesacceptFile types to accept, e.g. image/*,.pdf
Show the imagepreviewAn image shows itself across the field instead of its name - tapping it picks another. Read only, it is only the image.
Image shapeaspectoriginal, 1:1, 3:4, 4:3With Show the image: original keeps the image's own shape; a ratio frames it (3:4 portrait - a carnet photo).
HeightheightIn pixels, whatever the screen: the empty area's - to line it up with the cards beside it - and, with Show the image, the image's (with a shape its width follows, centered; without, it spans the field; it covers the frame).
IconiconƒAn icon at its start.
ColorcolorƒOne of the theme's colors - primary, error, success...
Variantvariantƒ; area, buttonIts style: filled, outlined, soft...
Sizesizexs, sm, md, lg, xlFrom xs to xl - Default is md.
DisableddisabledƒShown greyed out - it can't be used.

Events

EventCodeReceives
File changedupdate:modelValue{ value }

Methods

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

MethodCode
Openopen()Opens the file picker

Scanner

Reads a QR code, a barcode or a PDF417 (such as an ID card) with the camera, or from a USB reader typing into a field or into the whole page.

TScanner · TotalBase

Reads a QR code, a PDF417 (a DNI) or a barcode - with the device's camera or a USB reader in keyboard mode - and emits what it read.

Edits: text columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable that keeps the last code read (or a record column it fills).
Text fieldinputdefault trueA field where a USB reader types (or a person does) - Enter reads it.
Cameracameradefault trueA button that opens the camera to read a code. The browser allows it only over HTTPS (or on localhost).
USB readerlistenfield, pagefield: what's typed in its text field; page: a reader's burst of keys anywhere on the page, with nothing focused - for a kiosk.
FormatsformatsThe codes the camera reads, comma-separated - empty: all of them. qr_code, pdf417, code_128, code_39, code_93, ean_13, ean_8, upc_a, upc_e, itf, codabar, data_matrix, aztec.
Keep readingcontinuousThe camera stays open after a read, for the next one (the same code again only after a pause).
Beepbeepdefault trueA short tone on each read.
Vibratevibratedefault trueA short vibration on each read, where the device can.
Camera buttonlabelƒThe camera button's text - empty: an icon only.
IconiconƒThe camera button's icon - unset: a barcode.
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.
DisableddisabledƒShown greyed out - it can't be used.

Events

EventCodeReceives
Scannedscan{ value, format, source } - the text read, its format (qr_code, pdf417, ... - null from a USB reader) and camera | keyboard
Value changedupdate:modelValue{ value }
Errorerror{ message } - the camera couldn't open (no permission, no HTTPS, no camera)

Methods

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

MethodCode
Openopen()Opens the camera to read a code
Closeclose()Closes the camera
Focusfocus()Puts the cursor in it

Example

{
  "widget": "TScanner",
  "name": "scanner",
  "props": {
    "listen": "page",
    "input": false,
    "camera": false
  },
  "emits": {
    "scan": "onScan"
  }
}

Camera

Takes a photo now, crops it to a shape and scales it down, and stores it as a file.

TCamera · TotalBase

Takes a photo with the device's camera, crops and compresses it, and stores it as a file - for a file column, like a person's photo.

Edits: file columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
ButtonlabelƒThe button's text - empty: Take photo.
Camerafacingenvironment, userenvironment: the back camera; user: the front one (a selfie). The viewer can switch.
Cropaspectoriginal, 1:1, 3:4, 4:3original keeps the photo as framed; a ratio crops it to that shape (1:1 square, 3:4 portrait - a carnet photo).
Largest sidemaxSizeIn pixels - a larger photo is scaled down to it (default 1600).
QualityqualityJPEG quality from 0.1 to 1 (default 0.85) - lower, a smaller file.
IconiconƒThe button's icon - unset: a camera.
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.
DisableddisabledƒShown greyed out - it can't be used.

Events

EventCodeReceives
Photo changedupdate:modelValue{ value } - the stored file's id

Methods

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

MethodCode
Openopen()Opens the camera to take a photo
Closeclose()Closes the camera

Signature

A pad to sign on with a finger, a pen or the mouse. The signature is stored as a PNG file.

TSignature · TotalBase

A pad to sign on with a finger or the mouse - stored as a PNG file, its value the file's id, like a Camera's. Clear starts over; a few ink colors. In a modal behind a button, with the signature shown on the page by a read-only Signature or Camera on the same column.

Edits: file columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
HeightheightThe pad's height in pixels (default 180) - it takes the field's width.
Ink colorscolorsA few colors to pick the ink from - off: black only.
Read onlyreadonlyƒThe signature shown, never changed - no pad, no Clear.
DisableddisabledƒShown greyed out - it can't be used.

Events

EventCodeReceives
Signedupdate:modelValue{ value } - the stored file's id, null when cleared

Methods

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

MethodCode
Clearclear()Starts over, with no value
Submitsubmit()Stores what's drawn as a PNG file now; a modal's Accept awaits it

Rich text

UEditor · Nuxt UI

A rich text editor - Markdown, HTML or JSON content.

Edits: text, JSON columns · A form field's input · Height: rows of 40 px, or Fill height

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Content typecontentTypemarkdown, html, json

Events

EventCodeReceives
Value changedupdate:modelValue{ value }

JSON

TJson · TotalBase

Structured data, edited as a tree.

Edits: JSON columns · A form field's input · Height: rows of 40 px, or Fill height

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
DisableddisabledƒShown greyed out - it can't be used.

Events

EventCodeReceives
Value changedupdate:modelValue{ value }

Color

TColorSelect · TotalBase

A palette color or any hex color.

Edits: text columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Clear buttonclearableAn ✕ that empties the value.
DisableddisabledƒShown greyed out - it can't be used.

Events

EventCodeReceives
Value changedupdate:modelValue{ value }

Map (Leaflet)

TLeafletMap · TotalBase

A point picked on an OpenStreetMap map - or the device's own position, with My location.

Edits: point columns · A form field's input · Height: rows of 40 px, or Fill height

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
My locationlocatedefault trueA button over the map that pins the device's position - still draggable after. The browser allows it only over HTTPS (or on localhost).
Locate on openlocateOnOpendefault falsePins the device's position when the field opens with no value.
DisableddisabledƒShown greyed out - it can't be used.

Events

EventCodeReceives
Point changedupdate:modelValue{ value } - { lng, lat }
Locatedlocated{ lng, lat, accuracy } - the device's position, accuracy in meters
Location failedlocateFailed{ reason, message } - insecure, unsupported, denied, unavailable or timeout

Methods

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

MethodCode
Locatelocate()Captures the device's position and pins it

Location

Captures the device's position into a point column: a Mark position button, or automatically when the form opens empty. Acme's technicians check in with it.

TGeolocation · TotalBase

The device's position into a point column, no map - a button, the coordinates once captured. Auto takes it when the field opens empty: where a reading was taken.

Edits: point columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
Automaticautodefault trueCaptures the position when the field opens with no value. The browser allows it only over HTTPS (or on localhost), and asks the viewer once.
Show coordinatesshowCoordinatesdefault trueLatitude and longitude beside the button once there's a value.
High accuracyhighAccuracydefault trueGPS over the network's guess - slower, exact.
LabellabelƒThe button's - unset: Mark position, then Again.
IconiconƒThe button's icon - unset: a crosshair.
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.
DisableddisabledƒShown greyed out - it can't be used.

Events

EventCodeReceives
Position changedupdate:modelValue{ value } - { lng, lat }
Locatedlocated{ lng, lat, accuracy } - the device's position, accuracy in meters
Location failedlocateFailed{ reason, message } - insecure, unsupported, denied, unavailable or timeout

Methods

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

MethodCode
Locatelocate()Captures the device's position into its value

Example

{
  "widget": "TGeolocation",
  "props": {
    "auto": true,
    "highAccuracy": true
  },
  "bindings": {
    "modelValue": {
      "variable": "checkIn"
    }
  },
  "emits": {
    "locateFailed": "onLocateFailed"
  }
}

Range

TRangeInput · TotalBase

A PostgreSQL range - from and to, with the date or number inputs its type takes; empty, no value.

Edits: range columns · A form field's input

Props

PropCodeTakes
ValuemodelValuea ValueA Value variable it reads and writes - or a formula (the link): shown read only, written nowhere, e.g. .
DisableddisabledƒShown greyed out - it can't be used.

Events

EventCodeReceives
Range changedupdate:modelValue{ value } - its PostgreSQL text: [from,to)

Next steps

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