Skip to main content

Slider

Description

The Slider type defines a control that behaves as a traditional slider. That is, it has a minimum and a maximum value and presents a track with a handle that can be dragged horizontally to change the current value of the control.

Properties

  • continuous (boolean, required) - Whether the scale of the control represents a continuous range or discrete values.
  • labels (Array<Slider.RangedLabels>, required) - A set of labels to display based on the current value of the control.
  • onSubmit (AnyUserInputAction, required) - The action to perform when the end user indicates the currently selected value is to be submitted.
  • title (string, required) - A label to display as a title for the control.
  • lowerBoundScaleLabel (string) - A label to display at the lower bound of the scale.
  • upperBoundScaleLabel (string) - A label to display at the upper bound of the scale.

Example

{
"type" : "Slider",
"continuous" : false,
"labels" : [
{
"labels" : [
{
"expression" : "floor($0)",
"text" : "%0.0f days"
}
],
"range" : [
0,
1
]
},
{
"labels" : [
{
"expression" : "floor($0)",
"text" : "%0.0f day"
}
],
"range" : [
1,
2
]
},
{
"labels" : [
{
"expression" : "floor($0)",
"text" : "%0.0f days"
}
],
"range" : [
2,
90
]
}
],
"onSubmit" : {
"type" : "User.Submitted<Screening.Response>",
"value" : {
"key" : "concussion_int_number_of_days_missed",
"type" : "Screening.Response"
}
},
"title" : "Number of days missed",
"upperBoundScaleLabel" : "90 days ago"
}