Sliders

inkBoard provides a couple of slider styles. Although they are seperate elements, they can be used within the same Slider element by setting the style parameter.

class Slider

Element combining all the different sliders to be used in a single element.

Set the type of slider by setting the style property. Properties for any style can be passed as kwargs.

Available shorthand actions are:
  • generate: Generates the element’s image data.

  • update: Function to update an element via actions.

  • set-position: Sets the position of the slider.

Element Properties

property active_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the bar indicating the value.
Optional, defaults to "black"
property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Color of the element background.
Optional, defaults to None
property color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the slider line.
Optional, defaults to "black"
property end_colors: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
The colors applied to the end icons. If None, will use the same color as the slider.
Optional, defaults to None
property inactive_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the inside part of the slider that is not covered by the active part.
Optional, defaults to None
property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Color of the box’s outline.
Optional, defaults to "black"
property thumb_color
Show a small line at the end of the active bar with color thumb_color. Set to None for no thumb.
Optional, defaults to None
property thumb_icon_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the thumb icon. If None a color is automatically applied.
Optional, defaults to None
property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is held. Set to None to have nothing called. If set to a dict, the values for hold_action_data and hold_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is released from being held down. This function is only available on devices with the HOLD_RELEASE feature. Set to None to have nothing called. If set to a dict, the values for hold_release_action_data and hold_release_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property on_position_set: Callable[[_BaseSlider, float | int], Any]
Action that is called whenever the slider’s position changes. Passes the element and the new position.
Optional, defaults to None
property tap_action: str | Callable[[Element, InteractEvent, Any], Any] | None
Slider tap_action that allows intercepting touches to update the position. First updates the slider position, then calls the set tap_action. tap_action can be set by changing tap_action without it interfering with the slider update (I think). Use Slider._tap_action to access the actual function after setting.
Optional, defaults to None
property end_point_size: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Size of the end point icons.
Optional, defaults to None
property end_points: str | tuple[str, str] | None
MDI icons located on both ends of the slider. Set to a string to use the same icon for both endpoints, otherwise set to a 2 element tuple or list with the end points on [min,max] respectively.
Optional, defaults to None
property feedback_duration: duration
Duration of the element’s feedback function The time an element will stay in ‘feedback state’, before returning to its normal state. Can be set to a string, which will be parsed to the right amount of seconds.
Optional, defaults to 0.75
property interactive: bool
If true, clicking on the slider will update the position to that place.
Optional, defaults to True
property maximum: float
The highest possible value the slider can take.
Optional, defaults to 100
property minimum: float
The lowest possible value the slider can take.
Optional, defaults to 0
property orientation: Literal['horizontal', 'vertical']
The orientation of the slider. Horizontal or Vertical.
Optional, defaults to "horizontal"
property outline_width: str | int | float
Width of the box’s outline.
Optional, defaults to 5
property position: int | float
The position of the slider within the defined value range.
Optional, defaults to None
property radius: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Corner radius of the box.
Optional, defaults to 5
property style: Literal['line', 'box']
The style of the slider, i.e. whether it displays a box or line slider. When changing this after initiating the instance object, it should work out of the box, but be mindful things may work wonky.
Optional, defaults to "line"
property thumb: str
The type of thumb (slider handle).
Optional, defaults to "rounded_rectangle"
property thumb_height: str | int | float
The height of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings. Set to None for automatic sizing based on shape.
Optional, defaults to None
property thumb_icon: str | None
Icon to put on the thumb, set to None for no icon. Size is set according to thumb_height, so ensure your thumb fits an icon.
Optional, defaults to None
property thumb_width: str | int | float
The width of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings. Set to None for automatic sizing based on shape.
Optional, defaults to None
property width: str | int | float
The width of the slider line.
Optional, defaults to None
property active_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to "black"

property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to None

property color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to "black"

property end_colors: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to None

property inactive_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to None

property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to "black"

property thumb_color

Optional, defaults to None

property thumb_icon_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to None

property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property on_position_set: Callable[[_BaseSlider, float | int], Any]

Optional, defaults to None

property tap_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property end_point_size: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to None

property end_points: str | tuple[str, str] | None

Optional, defaults to None

property feedback_duration: duration

Optional, defaults to 0.75

property interactive: bool

Optional, defaults to True

property maximum: float

Optional, defaults to 100

property minimum: float

Optional, defaults to 0

property orientation: Literal['horizontal', 'vertical']

Optional, defaults to "horizontal"

property outline_width: str | int | float

Optional, defaults to 5

property position: int | float

Optional, defaults to None

property radius: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to 5

property style: Literal['line', 'box']

Optional, defaults to "line"

property thumb: str

Optional, defaults to "rounded_rectangle"

property thumb_height: str | int | float

Optional, defaults to None

property thumb_icon: str | None

Optional, defaults to None

property thumb_width: str | int | float

Optional, defaults to None

property width: str | int | float

Optional, defaults to None

  • active_color, Optional, defaults to "black". The color of the bar indicating the value

  • background_color, Optional, defaults to None. Color of the element background.

  • color, Optional, defaults to "black". The color of the slider line

  • end_colors, Optional, defaults to None. The colors applied to the end icons. If None, will use the same color as the slider.

  • inactive_color, Optional, defaults to None. The color of the inside part of the slider that is not covered by the active part

  • outline_color, Optional, defaults to "black". Color of the box’s outline

  • thumb_color, Optional, defaults to None. Show a small line at the end of the active bar with color thumb_color. Set to None for no thumb

  • thumb_icon_color, Optional, defaults to None. The color of the thumb icon. If None a color is automatically applied.

  • hold_action, Optional, defaults to None. The function called when the element is held.

  • hold_release_action, Optional, defaults to None. The function called when the element is released from being held down.

  • on_position_set, Optional, defaults to None. Action that is called whenever the slider’s position changes.

  • tap_action, Optional, defaults to None. Slider tap_action that allows intercepting touches to update the position.

  • end_point_size, Optional, defaults to None. Size of the end point icons

  • end_points, Optional, defaults to None. MDI icons located on both ends of the slider. Set to a string to use the same icon for both endpoints, otherwise set to a 2 element tuple or list with the end points on [min,max] respectively.

  • feedback_duration, Optional, defaults to 0.75. Duration of the element’s feedback function

  • interactive, Optional, defaults to True. If true, clicking on the slider will update the position to that place.

  • maximum, Optional, defaults to 100. The highest possible value the slider can take

  • minimum, Optional, defaults to 0. The lowest possible value the slider can take.

  • orientation, Optional, defaults to "horizontal". The orientation of the slider. Horizontal or Vertical.

  • outline_width, Optional, defaults to 5. Width of the box’s outline

  • position, Optional, defaults to None. The position of the slider within the defined value range

  • radius, Optional, defaults to 5. Corner radius of the box

  • style, Optional, defaults to "line". The style of the slider, i.e. whether it displays a box or line slider.

  • thumb, Optional, defaults to "rounded_rectangle". The type of thumb (slider handle)

  • thumb_height, Optional, defaults to None. The height of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings.

  • thumb_icon, Optional, defaults to None. Icon to put on the thumb, set to None for no icon.

  • thumb_width, Optional, defaults to None. The width of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings.

  • width, Optional, defaults to None. The width of the slider line

class TimerSlider

A slider that can be used as a timer. Minimum and Maximum will be assumed to be in seconds.

Available shorthand actions are:
  • generate: Generates the element’s image data.

  • update: Function to update an element via actions.

  • set-position: Sets the position of the slider.

  • start-timer: Starts the timer. If the timer previously reached its end, it will be restarted.

  • pause-timer: Pauses the timer without resetting its position.

  • cancel-timer: Stops the timer from running, and resets the position to its minimum/maximum (for count up/down respectively)

  • toggle-timer: Toggles the timer between running and paused

Element Properties

property active_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the bar indicating the value.
Optional, defaults to "black"
property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Color of the element background.
Optional, defaults to None
property color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the slider line.
Optional, defaults to "black"
property end_colors: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
The colors applied to the end icons. If None, will use the same color as the slider.
Optional, defaults to None
property inactive_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the inside part of the slider that is not covered by the active part.
Optional, defaults to None
property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Color of the box’s outline.
Optional, defaults to "black"
property thumb_color
Show a small line at the end of the active bar with color thumb_color. Set to None for no thumb.
Optional, defaults to None
property thumb_icon_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the thumb icon. If None a color is automatically applied.
Optional, defaults to None
property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is held. Set to None to have nothing called. If set to a dict, the values for hold_action_data and hold_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is released from being held down. This function is only available on devices with the HOLD_RELEASE feature. Set to None to have nothing called. If set to a dict, the values for hold_release_action_data and hold_release_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property on_position_set: Callable[[_BaseSlider, float | int], Any]
Action that is called whenever the slider’s position changes. Passes the element and the new position.
Optional, defaults to None
property tap_action: str | Callable[[Element, InteractEvent, Any], Any] | None
Slider tap_action that allows intercepting touches to update the position. First updates the slider position, then calls the set tap_action. tap_action can be set by changing tap_action without it interfering with the slider update (I think). Use Slider._tap_action to access the actual function after setting.
Optional, defaults to None
property end_point_size: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Size of the end point icons.
Optional, defaults to None
property end_points: str | tuple[str, str] | None
MDI icons located on both ends of the slider. Set to a string to use the same icon for both endpoints, otherwise set to a 2 element tuple or list with the end points on [min,max] respectively.
Optional, defaults to None
property feedback_duration: duration
Duration of the element’s feedback function The time an element will stay in ‘feedback state’, before returning to its normal state. Can be set to a string, which will be parsed to the right amount of seconds.
Optional, defaults to 0.75
property interactive: bool
If true, clicking on the slider will update the position to that place.
Optional, defaults to False
property maximum: float
The highest possible value the slider can take.
Optional, defaults to 100
property minimum: float
The lowest possible value the slider can take.
Optional, defaults to 0
property orientation: Literal['horizontal', 'vertical']
The orientation of the slider. Horizontal or Vertical.
Optional, defaults to "horizontal"
property outline_width: str | int | float
Width of the box’s outline.
Optional, defaults to 5
property position: int | float
The position of the slider within the defined value range.
Optional, defaults to None
property radius: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Corner radius of the box.
Optional, defaults to 5
property style: Literal['line', 'box']
The style of the slider, i.e. whether it displays a box or line slider. When changing this after initiating the instance object, it should work out of the box, but be mindful things may work wonky.
Optional, defaults to "line"
property thumb: str
The type of thumb (slider handle).
Optional, defaults to "rounded_rectangle"
property thumb_height: str | int | float
The height of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings. Set to None for automatic sizing based on shape.
Optional, defaults to None
property thumb_icon: str | None
Icon to put on the thumb, set to None for no icon. Size is set according to thumb_height, so ensure your thumb fits an icon.
Optional, defaults to None
property thumb_width: str | int | float
The width of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings. Set to None for automatic sizing based on shape.
Optional, defaults to None
property width: str | int | float
The width of the slider line.
Optional, defaults to None
property active_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to "black"

property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to None

property color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to "black"

property end_colors: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to None

property inactive_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to None

property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to "black"

property thumb_color

Optional, defaults to None

property thumb_icon_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to None

property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property on_position_set: Callable[[_BaseSlider, float | int], Any]

Optional, defaults to None

property tap_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property end_point_size: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to None

property end_points: str | tuple[str, str] | None

Optional, defaults to None

property feedback_duration: duration

Optional, defaults to 0.75

property interactive: bool

Optional, defaults to False

property maximum: float

Optional, defaults to 100

property minimum: float

Optional, defaults to 0

property orientation: Literal['horizontal', 'vertical']

Optional, defaults to "horizontal"

property outline_width: str | int | float

Optional, defaults to 5

property position: int | float

Optional, defaults to None

property radius: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to 5

property style: Literal['line', 'box']

Optional, defaults to "line"

property thumb: str

Optional, defaults to "rounded_rectangle"

property thumb_height: str | int | float

Optional, defaults to None

property thumb_icon: str | None

Optional, defaults to None

property thumb_width: str | int | float

Optional, defaults to None

property width: str | int | float

Optional, defaults to None

  • active_color, Optional, defaults to "black". The color of the bar indicating the value

  • background_color, Optional, defaults to None. Color of the element background.

  • color, Optional, defaults to "black". The color of the slider line

  • end_colors, Optional, defaults to None. The colors applied to the end icons. If None, will use the same color as the slider.

  • inactive_color, Optional, defaults to None. The color of the inside part of the slider that is not covered by the active part

  • outline_color, Optional, defaults to "black". Color of the box’s outline

  • thumb_color, Optional, defaults to None. Show a small line at the end of the active bar with color thumb_color. Set to None for no thumb

  • thumb_icon_color, Optional, defaults to None. The color of the thumb icon. If None a color is automatically applied.

  • hold_action, Optional, defaults to None. The function called when the element is held.

  • hold_release_action, Optional, defaults to None. The function called when the element is released from being held down.

  • on_position_set, Optional, defaults to None. Action that is called whenever the slider’s position changes.

  • tap_action, Optional, defaults to None. Slider tap_action that allows intercepting touches to update the position.

  • end_point_size, Optional, defaults to None. Size of the end point icons

  • end_points, Optional, defaults to None. MDI icons located on both ends of the slider. Set to a string to use the same icon for both endpoints, otherwise set to a 2 element tuple or list with the end points on [min,max] respectively.

  • feedback_duration, Optional, defaults to 0.75. Duration of the element’s feedback function

  • interactive, Optional, defaults to False. If true, clicking on the slider will update the position to that place.

  • maximum, Optional, defaults to 100. The highest possible value the slider can take

  • minimum, Optional, defaults to 0. The lowest possible value the slider can take.

  • orientation, Optional, defaults to "horizontal". The orientation of the slider. Horizontal or Vertical.

  • outline_width, Optional, defaults to 5. Width of the box’s outline

  • position, Optional, defaults to None. The position of the slider within the defined value range

  • radius, Optional, defaults to 5. Corner radius of the box

  • style, Optional, defaults to "line". The style of the slider, i.e. whether it displays a box or line slider.

  • thumb, Optional, defaults to "rounded_rectangle". The type of thumb (slider handle)

  • thumb_height, Optional, defaults to None. The height of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings.

  • thumb_icon, Optional, defaults to None. Icon to put on the thumb, set to None for no icon.

  • thumb_width, Optional, defaults to None. The width of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings.

  • width, Optional, defaults to None. The width of the slider line

Below are the base classes for the slider styles, line and box.

class LineSlider

Makes an (interactive) slider with a thumb and a line.

See _BaseSlider for all slider specific parameters.

Available shorthand actions are:
  • generate: Generates the element’s image data.

  • update: Function to update an element via actions.

  • set-position: Sets the position of the slider.

Element Properties

property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Color of the element background.
Optional, defaults to None
property color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the slider line.
Optional, defaults to "black"
property end_colors: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
The colors applied to the end icons. If None, will use the same color as the slider.
Optional, defaults to None
property thumb_icon_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the thumb icon. If None a color is automatically applied.
Optional, defaults to None
property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is held. Set to None to have nothing called. If set to a dict, the values for hold_action_data and hold_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is released from being held down. This function is only available on devices with the HOLD_RELEASE feature. Set to None to have nothing called. If set to a dict, the values for hold_release_action_data and hold_release_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property on_position_set: Callable[[_BaseSlider, float | int], Any]
Action that is called whenever the slider’s position changes. Passes the element and the new position.
Optional, defaults to None
property tap_action: str | Callable[[Element, InteractEvent, Any], Any] | None
Slider tap_action that allows intercepting touches to update the position. First updates the slider position, then calls the set tap_action. tap_action can be set by changing tap_action without it interfering with the slider update (I think). Use Slider._tap_action to access the actual function after setting.
Optional, defaults to None
property end_points: str | tuple[str, str] | None
MDI icons located on both ends of the slider. Set to a string to use the same icon for both endpoints, otherwise set to a 2 element tuple or list with the end points on [min,max] respectively.
Optional, defaults to None
property feedback_duration: duration
Duration of the element’s feedback function The time an element will stay in ‘feedback state’, before returning to its normal state. Can be set to a string, which will be parsed to the right amount of seconds.
Optional, defaults to 0.75
property interactive: bool
If true, clicking on the slider will update the position to that place.
Optional, defaults to True
property maximum: float
The highest possible value the slider can take.
Optional, defaults to 100
property minimum: float
The lowest possible value the slider can take.
Optional, defaults to 0
property orientation: Literal['horizontal', 'vertical']
The orientation of the slider. Horizontal or Vertical.
Optional, defaults to "horizontal"
property position: int | float
The position of the slider within the defined value range.
Optional, defaults to None
property thumb: str
The type of thumb (slider handle).
Optional, defaults to "rounded_rectangle"
property thumb_height: str | int | float
The height of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings. Set to None for automatic sizing based on shape.
Optional, defaults to None
property thumb_icon: str | None
Icon to put on the thumb, set to None for no icon. Size is set according to thumb_height, so ensure your thumb fits an icon.
Optional, defaults to None
property thumb_width: str | int | float
The width of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings. Set to None for automatic sizing based on shape.
Optional, defaults to None
property width: str | int | float
The width of the slider line.
Optional, defaults to None
property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to None

property color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to "black"

property end_colors: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to None

property thumb_icon_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to None

property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property on_position_set: Callable[[_BaseSlider, float | int], Any]

Optional, defaults to None

property tap_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property end_points: str | tuple[str, str] | None

Optional, defaults to None

property feedback_duration: duration

Optional, defaults to 0.75

property interactive: bool

Optional, defaults to True

property maximum: float

Optional, defaults to 100

property minimum: float

Optional, defaults to 0

property orientation: Literal['horizontal', 'vertical']

Optional, defaults to "horizontal"

property position: int | float

Optional, defaults to None

property thumb: str

Optional, defaults to "rounded_rectangle"

property thumb_height: str | int | float

Optional, defaults to None

property thumb_icon: str | None

Optional, defaults to None

property thumb_width: str | int | float

Optional, defaults to None

property width: str | int | float

Optional, defaults to None

  • background_color, Optional, defaults to None. Color of the element background.

  • color, Optional, defaults to "black". The color of the slider line

  • end_colors, Optional, defaults to None. The colors applied to the end icons. If None, will use the same color as the slider.

  • thumb_icon_color, Optional, defaults to None. The color of the thumb icon. If None a color is automatically applied.

  • hold_action, Optional, defaults to None. The function called when the element is held.

  • hold_release_action, Optional, defaults to None. The function called when the element is released from being held down.

  • on_position_set, Optional, defaults to None. Action that is called whenever the slider’s position changes.

  • tap_action, Optional, defaults to None. Slider tap_action that allows intercepting touches to update the position.

  • end_points, Optional, defaults to None. MDI icons located on both ends of the slider. Set to a string to use the same icon for both endpoints, otherwise set to a 2 element tuple or list with the end points on [min,max] respectively.

  • feedback_duration, Optional, defaults to 0.75. Duration of the element’s feedback function

  • interactive, Optional, defaults to True. If true, clicking on the slider will update the position to that place.

  • maximum, Optional, defaults to 100. The highest possible value the slider can take

  • minimum, Optional, defaults to 0. The lowest possible value the slider can take.

  • orientation, Optional, defaults to "horizontal". The orientation of the slider. Horizontal or Vertical.

  • position, Optional, defaults to None. The position of the slider within the defined value range

  • thumb, Optional, defaults to "rounded_rectangle". The type of thumb (slider handle)

  • thumb_height, Optional, defaults to None. The height of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings.

  • thumb_icon, Optional, defaults to None. Icon to put on the thumb, set to None for no icon.

  • thumb_width, Optional, defaults to None. The width of the slider thumb. Parameter l for the length of the slider is additionally passed for dimensional strings.

  • width, Optional, defaults to None. The width of the slider line

class BoxSlider

Makes an (interactive) slider that fills a box.

See _BaseSlider for all slider specific parameters.

Available shorthand actions are:
  • generate: Generates the element’s image data.

  • update: Function to update an element via actions.

  • set-position: Sets the position of the slider.

Element Properties

property active_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the bar indicating the value.
Optional, defaults to "black"
property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Color of the element background.
Optional, defaults to None
property end_colors: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Colors of the icons at the box’s end.
Optional, defaults to None
property inactive_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
The color of the inside part of the slider that is not covered by the active part.
Optional, defaults to None
property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Color of the box’s outline.
Optional, defaults to "black"
property thumb_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Show a small line at the end of the active bar with color thumb_color. Set to None for no thumb.
Optional, defaults to None
property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is held. Set to None to have nothing called. If set to a dict, the values for hold_action_data and hold_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is released from being held down. This function is only available on devices with the HOLD_RELEASE feature. Set to None to have nothing called. If set to a dict, the values for hold_release_action_data and hold_release_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property on_position_set: Callable[[_BaseSlider, float | int], Any]
Action that is called whenever the slider’s position changes. Passes the element and the new position.
Optional, defaults to None
property tap_action: str | Callable[[Element, InteractEvent, Any], Any] | None
Slider tap_action that allows intercepting touches to update the position. First updates the slider position, then calls the set tap_action. tap_action can be set by changing tap_action without it interfering with the slider update (I think). Use Slider._tap_action to access the actual function after setting.
Optional, defaults to None
property end_point_size: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Size of the end point icons.
Optional, defaults to None
property end_points: str | tuple[str, str] | None
MDI icons located on both ends of the slider. Set to a string to use the same icon for both endpoints, otherwise set to a 2 element tuple or list with the end points on [min,max] respectively.
Optional, defaults to None
property feedback_duration: duration
Duration of the element’s feedback function The time an element will stay in ‘feedback state’, before returning to its normal state. Can be set to a string, which will be parsed to the right amount of seconds.
Optional, defaults to 0.75
property interactive: bool
If true, clicking on the slider will update the position to that place.
Optional, defaults to True
property maximum: float
The highest possible value the slider can take.
Optional, defaults to 100
property minimum: float
The lowest possible value the slider can take.
Optional, defaults to 0
property orientation: Literal['horizontal', 'vertical']
The orientation of the slider. Horizontal or Vertical.
Optional, defaults to "horizontal"
property outline_width: str | int | float
Width of the box’s outline.
Optional, defaults to 5
property position: int | float
The position of the slider within the defined value range.
Optional, defaults to None
property radius: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Corner radius of the box.
Optional, defaults to 5
property active_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to "black"

property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to None

property end_colors: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to None

property inactive_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to None

property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to "black"

property thumb_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to None

property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property on_position_set: Callable[[_BaseSlider, float | int], Any]

Optional, defaults to None

property tap_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property end_point_size: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to None

property end_points: str | tuple[str, str] | None

Optional, defaults to None

property feedback_duration: duration

Optional, defaults to 0.75

property interactive: bool

Optional, defaults to True

property maximum: float

Optional, defaults to 100

property minimum: float

Optional, defaults to 0

property orientation: Literal['horizontal', 'vertical']

Optional, defaults to "horizontal"

property outline_width: str | int | float

Optional, defaults to 5

property position: int | float

Optional, defaults to None

property radius: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to 5

  • active_color, Optional, defaults to "black". The color of the bar indicating the value

  • background_color, Optional, defaults to None. Color of the element background.

  • end_colors, Optional, defaults to None. Colors of the icons at the box’s end

  • inactive_color, Optional, defaults to None. The color of the inside part of the slider that is not covered by the active part

  • outline_color, Optional, defaults to "black". Color of the box’s outline

  • thumb_color, Optional, defaults to None. Show a small line at the end of the active bar with color thumb_color. Set to None for no thumb

  • hold_action, Optional, defaults to None. The function called when the element is held.

  • hold_release_action, Optional, defaults to None. The function called when the element is released from being held down.

  • on_position_set, Optional, defaults to None. Action that is called whenever the slider’s position changes.

  • tap_action, Optional, defaults to None. Slider tap_action that allows intercepting touches to update the position.

  • end_point_size, Optional, defaults to None. Size of the end point icons

  • end_points, Optional, defaults to None. MDI icons located on both ends of the slider. Set to a string to use the same icon for both endpoints, otherwise set to a 2 element tuple or list with the end points on [min,max] respectively.

  • feedback_duration, Optional, defaults to 0.75. Duration of the element’s feedback function

  • interactive, Optional, defaults to True. If true, clicking on the slider will update the position to that place.

  • maximum, Optional, defaults to 100. The highest possible value the slider can take

  • minimum, Optional, defaults to 0. The lowest possible value the slider can take.

  • orientation, Optional, defaults to "horizontal". The orientation of the slider. Horizontal or Vertical.

  • outline_width, Optional, defaults to 5. Width of the box’s outline

  • position, Optional, defaults to None. The position of the slider within the defined value range

  • radius, Optional, defaults to 5. Corner radius of the box