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
Name | Type | Description |
---|---|---|
id | string | Assigns a name for the given field on the backend. This name can be used to refer this field in another field |
label | string | Adds a label to the given field |
isRequired | boolean | Makes a field mandatory |
showInTable | boolean | Displays the field in a table after saving the entry |
units | array | Stores the unit options which are presented to the user to select |
defaultValue | string | Sets a default value for the given field |