Unit
Unit numbers can be used to enter numerical quantities of time, length, mass, area, force, energy, or pressure. The number can be entered in whichever unit is preferred from a given list of options. Before processing, the number is converted to a consistent unit specified by the tool, avoiding the need to handle conversion manually.
Example
{
type: "unit",
value: 12300000,
unit: "ms",
options: ["h m s"],
label: "Unit",
}
Options
Input
Use these options when using the field with take
.
value? | The initial value of the field. |
unit | The preferred unit to receive, regardless of the units that are currently selected by the user. |
options? | The units that are available to choose from. |
min? | The minimum value that will be accepted. |
max? | The maximum value that will be accepted. |
step? | The amount by which to increment the value. |
key? | A key to access the value. If provided, each field must have a unique key. See make for more information about accessing values. |
label? | A label describing the purpose of the field. |
detail? | Additional information about the field, disclosed in a tooltip. |
required? | Whether or not this field is required. |
Output
Use these options when using the field with make
.
value? | The initial value of the field. |
unit | The preferred unit to receive, regardless of the units that are currently selected by the user. |
label? | A label describing the purpose of the field. |
detail? | Additional information about the field, disclosed in a tooltip. |
required? | Whether or not this field is required. |
Data
If the input has a value, the field will pass a number
between min
and max
, or undefined
if one hasn’t been set yet.