Number

Numbers can be used to input numerical values. Buttons increase and decrease the value by an amount specified with the step attribute. You can also set minimum and maximum values.

Example

{
  type: "number",
  label: "Number",
  value: 23,
}

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.
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 output value of the field.

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.