Unit

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",
  label: "Unit",
  value: 12345000,
  unit: "ms",
  options: ["h m s"],
}

Options

Input

Use these options when using the field with take.

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 |‌ false
A label describing the purpose of the field. Setting the label to false removes the element, which can be useful when nested as the only child within a group.
detail?
string
Additional information about the field, disclosed in a tooltip.
required?
boolean
Whether or not this field is required.
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.

Output

Use these options when using the field with make.

label?
string |‌ false
A label describing the purpose of the field. Setting the label to false removes the element, which can be useful when nested as the only child within a group.
detail?
string
Additional information about the field, disclosed in a tooltip.
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.

Data

If the input has a value, the field will pass a number between min and max, or 0 if one hasn’t been set yet.