Static CMS
Star StaticJsCMS/static-cms on GitHub
DocsContributingCommunity

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.

NameTypeDefaultDescription
defaultstring
| 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
minnumberOptional. Minimum value accepted
maxnumberOptional. Maximum value accepted
stepnumber1Optional. Size of steps when stepping up or down in input

Example

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