Number with Unit

This field is used to input a number along with a user given unit measure.

{
"type": "number-unit",
"id": "number-unit",
"label": "Number Unit",
"showInTable": true,
"isRequired": true,
"units": ["kg", "g", "mg"],
"defaultValue": {
"unit": "mg",
"value": 1
}
}

The example above inputs a number and allows the user to select from the 3 given weight units. It also has the defaultValue function where the unit is set to mg and the value is 1.

Field Attributes

NameTypeDescription
idstringAssigns a name for the given field on the backend. This name can be used to refer this field in another field
labelstringAdds a label to the given field
isRequiredbooleanMakes a field mandatory
showInTablebooleanDisplays the field in a table after saving the entry
unitsarrayStores the unit options which are presented to the user to select
defaultValuestringSets a default value for the given field