Range Slider
Last Updated: August 10, 2015
- class tethys_sdk.gizmos.RangeSlider(name, min, max, initial, step, disabled=False, display_text='', error='', success='', attributes=None, classes='')
Sliders can be used to request an input value from a range of possible values. A slider is configured with a dictionary of key-value options. The table below summarizes the options for sliders.
- attributes
A dictionary representing additional HTML attributes to add to the primary element (e.g. {"onclick": "run_me();"}).
- Type:
dict
- classes
Additional classes to add to the primary HTML element (e.g. "example-class another-class").
- Type:
str
Example
pythonfrom tethys_sdk.gizmos import RangeSlider slider1 = RangeSlider(display_text='Slider 1', name='slider1', min=0, max=100, initial=50, step=1) slider2 = RangeSlider(display_text='Slider 2', name='slider2', min=0, max=1, initial=0.5, step=0.1, disabled=True, error='Incorrect, please choose another value.') context = { 'slider1': slider1, 'slider2': slider2, }
Template Example
python{% gizmo slider1 %} {% gizmo slider2 %}