{"id":7274,"library":"gradio-rangeslider","title":"Gradio RangeSlider","description":"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]","status":"active","version":"0.0.8","language":"en","source_language":"en","source_url":"https://github.com/freddyaboulton/gradio-range-slider","tags":["Gradio","Slider","UI","Component","Range","Custom Component"],"install":[{"cmd":"pip install gradio-rangeslider","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"This is a custom component built on top of the Gradio framework.","package":"gradio","optional":false}],"imports":[{"symbol":"RangeSlider","correct":"from gradio_rangeslider import RangeSlider"}],"quickstart":{"code":"import gradio as gr\nfrom gradio_rangeslider import RangeSlider\n\ndef update_range_text(selected_range: tuple[float, float]) -> str:\n    min_val, max_val = selected_range\n    return f\"Selected range: {min_val:.1f} to {max_val:.1f}\"\n\nwith gr.Blocks() as demo:\n    gr.Markdown(\"## Custom RangeSlider Demo\")\n    \n    # Initialize RangeSlider with a default range\n    range_slider = RangeSlider(\n        minimum=0,\n        maximum=100,\n        value=(20, 80),\n        label=\"Select a range\",\n        step=0.5\n    )\n    \n    # Display the selected range\n    range_output = gr.Markdown(value=\"Selected range: 20.0 to 80.0\")\n\n    # Connect the RangeSlider's change event to the update function\n    range_slider.change(\n        fn=update_range_text,\n        inputs=range_slider,\n        outputs=range_output,\n        show_progress=\"hidden\"\n    )\n    \n    gr.Examples(\n        [([10, 30]), ([50, 75])],\n        inputs=[range_slider],\n        outputs=[range_output],\n        fn=update_range_text,\n        label=\"Examples for RangeSlider\"\n    )\n\nif __name__ == \"__main__\":\n    demo.launch()","lang":"python","description":"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]"},"warnings":[{"fix":"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]","message":"The `gradio-rangeslider` component specifies compatibility with `gradio>=4.0,<6.0`. Upgrading your main `gradio` library to version `6.0` or higher may introduce breaking changes or require adjustments to how this custom component interacts with the Gradio API, due to significant changes in Gradio 6.x. [4, 12, 15]","severity":"breaking","affected_versions":"gradio>=6.0.0"},{"fix":"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`.","message":"Unlike the standard `gradio.Slider` which handles a single float value, the `gradio_rangeslider.RangeSlider` component expects and provides a `tuple[float, float]` representing the `(min_value, max_value)` of the selected range. [2, 7, 9]","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"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].","cause":"When packaging a Gradio application with PyInstaller, custom components like `gradio-rangeslider` may not have their necessary data files automatically collected, leading to this import error at runtime. [10]","error":"ModuleNotFoundError: No module named 'gradio_rangeslider'"},{"fix":"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`.","cause":"This error typically occurs when a Python function connected to the `RangeSlider` expects a single float argument but receives the `(min_value, max_value)` tuple that `RangeSlider` outputs, and then attempts to access it like `value[0]` or `value[1]`. [2, 9]","error":"TypeError: 'float' object is not subscriptable"}]}