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?
number
The initial value of the field.
unit
string
The preferred unit to receive, regardless of the units that are currently selected by the user.
options?
string[]
The units that are available to choose from.
min?
number
The minimum value that will be accepted.
max?
number
The maximum value that will be accepted.
step?
number
The amount by which to increment the value.
key?
string
A key to access the value. If provided, each field must have a unique key. See make for more information about accessing values.
label?
string
A label describing the purpose of the field.
detail?
string
Additional information about the field, disclosed in a tooltip.
required?
boolean
Whether or not this field is required.

Output

Use these options when using the field with make.

value?
number
The initial value of the field.
unit
string
The preferred unit to receive, regardless of the units that are currently selected by the user.
label?
string
A label describing the purpose of the field.
detail?
string
Additional information about the field, disclosed in a tooltip.
required?
boolean
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.