App.slider

App.slider(title, value=0, minval=0, maxval=100, step=1, annotation='', bgcolor=None, parent=None)[source]

Decorator for slider actions.

Parameters:
  • title (str) – The text label of the slider.

  • value (int, optional) – Initial value of the slider.

  • minval (int, optional) – Minimum value of the sliding range.

  • maxval (int, optional) – Maximum value of the sliding range.

  • step (int, optional) – Size of the sliding step.

  • annotation (str, optional) – Value annotation.

Returns:

callable

Notes

Use this method to convert a function into the callback action of a slider, and automatically add the slider to the sidebar.

Examples

@viewer.slider(title='Slide me!')
def slide(app):
    app.info('Thanks for sliding...')