Slider with Gradio

Learn how to use sliders in Gradio!

Slider

Slider allows users to select on a continuous numerical scale defined within a minimum and maximum value. A Slider in Gradio can be instantiated with gr.Slider() or with Interface string shortcut 'slider'.

If the slider is passed as an input into a function, it will pass the slider value as a float into the function. If the slider is passed as an output value from a function, it expects the function to return an int or float and will set the slider value to it as long as it is in range.

Get hands-on with 1300+ tech skills courses.