Gradio RangeSlider is a custom Gradio component (version 0.0.8) that provides a user interface element for selecting a range of numerical values. It extends Gradio's capabilities by offering a dual-handle slider for specifying both a minimum and maximum value within a defined range. The library requires Python >=3.8 and is maintained with a slow release cadence, having last been updated on PyPI in October 2024. [1, 4]
pip install gradio-rangesliderVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import and use the `RangeSlider` component within a Gradio `Blocks` application. It sets up a slider from 0 to 100 with a default selection and dynamically updates a Markdown component to display the chosen range as the slider is adjusted. [2]
Ensure your `gradio` installation is within the `4.x` or `5.x` range (`pip install 'gradio<6.0'`) or consult Gradio's migration guide for custom components if you must use Gradio 6.x. [12, 15]
Ensure that functions connected to the `RangeSlider` (e.g., via `.change()`) are designed to accept a `tuple` with two float values as input, and similarly, return a `tuple` if setting its value programmatically. For example, `def handler(selected_range: tuple[float, float]): min_val, max_val = selected_range`.
Add `--collect-data=gradio_rangeslider` to your PyInstaller command or `.spec` file. Example: `pyinstaller --onefile --collect-data=gradio --collect-data=gradio_rangeslider your_app.py` [10].
Modify your Python function to correctly accept and unpack the tuple. For example, `def process_range(selected_values: tuple[float, float]): min_val, max_val = selected_values`.