Reference Fields
Slider
The Slider field lets users select a numeric value within a range by dragging a thumb. It stores a single number in the database.
Settings
The Slider field does not feature any distinctive settings beyond the standard ones in Strife Studio. Range configuration (min, max, step) is set in the JSON template definition — see below.
You can find a comprehensive list of all basic settings in the 'Overview' section.
Define with JSON
When defining templates using JSON, this field is represented using:
- Component Name:
str-slider - Type:
slider - Reference ID:
str-slider|slider
The settings above map into the editor.attributes object inside the JSON definition.
{
...
"editor": {
"name": "str-slider",
"type": "slider",
"propertyName": "...",
...
"attributes": {
"min": 0, //Lower bound of the range. Default 0.
"max": 100, //Upper bound of the range. Default 100.
"step": 1, //Increment step when dragging. Default 1.
"readonly": false, //Disables interaction when true. Default false.
"tooltip": true //Shows percentage tooltip on hover. Default true.
}
},
...
}The field stores a single number between min and max in the database.
Live preview
The compatible Strife Web Components for a Slider field are any of the text or container components.
For more information on live preview and Strife Web Components, please refer to the Live preview documentation.