1. Home
  2. Docs
  3. docs
  4. Widgets
  5. Number

Number

  • Name: number
  • UI: HTML number input
  • Data type: string or number. Configured by value_type option

The number widget uses an HTML number input, saving the value as a string, integer, or floating point number.

Widget Options

For common options, see Common widget options.

Name

Type

Default

Description

default

string
| number

''

Optional. The default value for the field. Accepts a string or number

value_type

‘int’
| ‘float’
| ‘string’

'string'

Optional. Accepts int or float; any other value results in saving as a string

min

number

Optional. Minimum value accepted. If a pattern is provided (see Common widget options), min is ignored during validation, but is still applied to the input

max

number

Optional. Maximum value accepted. If a pattern is provided (see Common widget options), max is ignored during validation, but is still applied to the input

step

number

1

Optional. Size of steps when stepping up or down in input

prefix

string

''

Optional. Text to show before number input

suffix

string

''

Optional. Text to show after number input

Example

name: 'puppies'
label: 'Puppy Count'
widget: 'number'
default: 2
value_type: 'int'
min: 1
max: 101
step: 2
name: 'puppies',
label: 'Puppy Count',
widget: 'number',
default: 2,
value_type: 'int',
min: 1,
max: 101,
step: 2,