Slider#

Sliders allow users to make selections from a range of values.

https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slider.png

API - kivymd.uix.slider.slider#

class kivymd.uix.slider.slider.MDSlider(**kwargs)#

Class for creating a Slider widget. See in the Slider class documentation.

active#

If the slider is clicked.

active is an BooleanProperty and defaults to False.

color#

Color slider.

MDSlider
    color: "red"
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slide-color.png

color is an ColorProperty and defaults to None.

hint#

If True, then the current value is displayed above the slider.

MDSlider
    hint: True
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slide-hint.png

hint is an BooleanProperty and defaults to True.

hint_bg_color#

Hint rectangle color in (r.g.b.a) format.

MDSlider
    hint: True
    hint_bg_color: "red"
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slide-hint-bg-color.png

hint_bg_color is an ColorProperty and defaults to [0, 0, 0, 0].

hint_text_color#

Hint text color in (r.g.b.a) format.

MDSlider
    hint: True
    hint_bg_color: "red"
    hint_text_color: "white"
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slide-hint-text-color.png

hint_text_color is an ColorProperty and defaults to None.

hint_radius#

Hint radius.

MDSlider
    hint: True
    hint_bg_color: "red"
    hint_text_color: "white"
    hint_radius: [6, 0, 6, 0]
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slide-hint-radius.png

hint_radius is an VariableListProperty and defaults to [dp(4), dp(4), dp(4), dp(4)].

thumb_color_active#

The color of the thumb when the slider is active.

New in version 1.0.0.

MDSlider
    thumb_color_active: "red"
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slide-thumb-color-active.png

thumb_color_active is an ColorProperty and default to None.

thumb_color_inactive#

The color of the thumb when the slider is inactive.

New in version 1.0.0.

MDSlider
    thumb_color_inactive: "red"
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slide-thumb-color-inactive.png

thumb_color_inactive is an ColorProperty and default to None.

thumb_color_disabled#

The color of the thumb when the slider is in the disabled state.

New in version 1.0.0.

MDSlider
    value: 55
    disabled: True
    thumb_color_disabled: "red"
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slide-thumb-color-disabled.png

thumb_color_disabled is an ColorProperty and default to None.

track_color_active#

The color of the track when the slider is active.

New in version 1.0.0.

MDSlider
    track_color_active: "red"
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slide-track-color-active.png

track_color_active is an ColorProperty and default to None.

track_color_inactive#

The color of the track when the slider is inactive.

New in version 1.0.0.

MDSlider
    track_color_inactive: "red"
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slide-track-color-inactive.png

track_color_inactive is an ColorProperty and default to None.

track_color_disabled#

The color of the track when the slider is in the disabled state.

New in version 1.0.0.

MDSlider
    disabled: True
    track_color_disabled: "red"
https://github.com/HeaTTheatR/KivyMD-data/raw/master/gallery/kivymddoc/slide-track-color-disabled.png

track_color_disabled is an ColorProperty and default to None.

show_off#

Show the ‘off’ ring when set to minimum value.

show_off is an BooleanProperty and defaults to True.

set_thumb_icon(self, *args)#
on_hint(self, instance, value)#
on_value_normalized(self, *args)#

When the value == min set it to ‘off’ state and make slider a ring.

on_show_off(self, *args)#
on__is_off(self, *args)#
on_active(self, *args)#
on_touch_down(self, touch)#

Receive a touch down event.

Parameters:
touch: MotionEvent class

Touch received. The touch is in parent coordinates. See relativelayout for a discussion on coordinate systems.

Returns:

bool If True, the dispatching of the touch event will stop. If False, the event will continue to be dispatched to the rest of the widget tree.

on_touch_up(self, touch)#

Receive a touch up event. The touch is in parent coordinates.

See on_touch_down() for more information.