Skip to content
Strife Docs

Reference Fields

Number

The Number field is designed for storing, validating, and formatting numeric data, with support for various numerical validation features.

Strife Studio screenshot of a Number field

Settings

In addition to the basic settings, this section provides information about unique settings and configurations specific to this field.

Note:

You can find a comprehensive list of all basic settings in the 'Overview' section.

OptionDescription
Placeholder
A brief hint or instruction displayed in an input field to guide users on the expected content or format.
Min
Defines the minimum permissible numeric value, establishing a lower limit for data entry.
Max
Establishes the maximum allowed numeric value, setting an upper limit for data entry.
Step
Specifies the extent of value change when users interact with the field. Set the desired increment, such as 1 for whole numbers, 0.1 for one decimal place, 0.01 for two decimal places, and so on.
Warning:

Please note that the Step setting is a mandatory requirement for enabling the use of decimal numbers within Strife Studio.

Define with JSON

When defining templates using JSON, this field is represented using:

  • Component Name: str-input
  • Type: number
  • Reference ID: str-input|number

The settings above map into the editor.attributes object inside the JSON definition.

JSON
{
  ...
  "editor": {
    "name": "str-input",
    "type": "number",
    "propertyName": "...",
    ...
    "attributes": {
      "placeholder": "...",
      "min": 0,              //Any number
      "max": 100,            //Any number
      "step": "..."
    }
  },
  ...
}

Live preview

The compatible Strife Web Components for a Number field are any of the text or container components.

Note:

For more information on live preview and Strife Web Components, please refer to the Live preview documentation.