Number Field Reference

The Number field allows content writers to add a numeric entry. You can set maximum and minimum values if needed.


The Number field allows editors to enter a number.

Screenshot of the Number field in the drag-and-drop editor.

The visual builder

When configuring a Number field, you'll see the options to set the Field name, API ID, and Field placeholder.

Slice Machine vs. Legacy Editor

Editing fields is almost identical in Slice Machine and the Legacy editor. But it is important to know that the mock config option (to add data to preview content fields in the Slice Simulator) is only available in Slice Machine.

Screenshot of the Number field editor.

JSON model

The following table displays the JSON keys and values of the field’s 'API response.

Edit the JSON model with caution

Only edit the JSON model to make changes to the Rich Text field labels. Making abrupt changes can cause conflicts when synchronizing changes with your documents.

type

string (required)

Value must be Number

config

object

Object for the configuration options

config.placeholder

string

A user-friendly placeholder for the field in the entry editor

config.label

string

The label that shows up for the field in the document editor

config.min

integer

The minimum allowable value for the number

config.max

integer

The maximum allowable value for the number

min and max can only be configured in the JSON editor.

Example JSON configuration

The following JSON defines a Number field with minimum and maximum values:

Copy
"example_number": {
  "type": "Number",
  "config": {
    "label": "Number",
    "min": 10,
    "max": 20
  }
}

API response example

Here is an API response example of a Number field with the API ID of example_number:

Copy
// API response example of a Number field

{
  //...
  "example_number": 12
}

Was this article helpful?
Not really
Yes, Thanks

Can't find what you're looking for? Spot an error in the documentation? Get in touch with us on our Community Forum or using the feedback form above.