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",
  value: 23,
  label: "Number",
}

Options

Input

Use these options when using the field with take.

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