num
The num property is used to define a numeric value.
If a step is provided, a slider will be used for the admin input and the numeric value will be rounded to the nearest multiple of the step.
import { atom, num } from '@iridiumcms/core';
export const sample = atom('sample', {
myNum: num(),
});
Configuration
The num field takes an optional configuration object with the following properties:
- minThe maximum value of the field. Defaults to
number1. - maxThe minimum value of the field. Defaults to
number0. - stepThe step size of the slider. Defaults to
numberundefined. - defaultValueThe default value of the field. Defaults to
stringundefined. - displayNameThe display name of the field. Defaults to the name of the property.
string - requiredWhether the field is required. Defaults to
booleanfalse. - searchableWhether the field is searchable. Defaults to
booleanfalse. - filterableAllows filtering the field. Defaults to
booleanfalse. - layoutThe layout of the field in the admin. Defaults to
LAYOUTLAYOUT.full.
