streamlit-super-slider


Namestreamlit-super-slider JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/fgdvir/streamlit-super-slider
SummaryA slider with a lot more features in it than the built in one.
upload_time2023-10-22 13:43:11
maintainer
docs_urlNone
authorDvir Itzkovits
requires_python>=3.6
license
keywords python streamlit react javascript
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # streamlit-super-slider
![](./assets/slider_img.png)

# Streamlit Super Slider

Streamlit Super Slider is a custom component for Streamlit that extends the functionality of the default slider. It provides a more interactive and user-friendly experience with additional features to enhance usability.

## Features

1. Updates Streamlit only on mouse release, not during dragging the mouse.
2. Includes an input text box attached to the slider where changing the value in either updates the value in the other (input text changes the slider and vice versa).
3. Arrow buttons to increase/decrease the value by one, providing a "next" or "previous" button functionality.
4. Built-in keyboard shortcuts for quick navigation: "," (comma) for previous and "." (period) for next.

## Installation

You can install the package via pip:

```pip install streamlit-super-slider```

## Arguments 

| Argument       | Type                                    | Description                                                                                                                                         | Default |
| -------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `min_value`    | int                                      | Minimum value for the slider.                                                                                                                       | 0       |
| `max_value`    | int (optional)                           | Maximum value for the slider. Must be specified if `values` is not provided.                                                                        | None    |
| `default_value`| int (optional)                           | The default value to set the slider to.                                                                                                             | 0       |
| `values`       | Union[List, Dict[int,str], None] (optional) | By default, the slider will have a range from `min_value` to `max_value`. Specify special set of values through a list or dict.                    | None    |
| `dots`         | bool (optional)                          | If True, will show dots on the slider for each step.                                                                                                | False   |
| `steps`        | int (optional)                           | Determines the spacing between the dots.                                                                                                            | None    |
| `key`          | Any (optional)                           | Streamlit key for the component.                                                                                                                    | None    |

## Usage

To use the Streamlit Super Slider in your Streamlit app, you simply need to import it and use the `st_slider` function:

```python
import streamlit as st
from streamlit_super_slider import st_slider

st.title("Streamlit Super Slider Example")

min_value = 0
max_value = 100
default_value = 50

# Use the Streamlit Super Slider component
slider_value = st_slider(min_value, max_value, default_value)

st.write("Slider with range")
value = st_slider(values={0: "zero", 10:'10', 25:'25', max_value: "max"}, key="my_slider2" ,dots=False)
st.write("Slider custom values from dictionary and steps")
value = st_slider(values={0: "zero", 10:'10', 20:'30', 90:'90', max_value: "max"}, key="my_slider2_steps" ,dots=False, steps=10)
st.write("Slider custom values from dictionary, steps and dots")
value = st_slider(values={0: "zero", 10:'10', 20:'30', 90:'90', max_value: "max"}, key="my_slider2_dots_steps" ,dots=True, steps=10)
st.write("Slider with custom values from list")
value = st_slider(values=[0,100,350,34560], key="my_slider3")

st.write(f"Selected value: {slider_value}")
```

## Demo

In the following demo you can see usage of the slider to show images, and all the different ways to chose where to go:
* Keyboard shortcut
* Pressing the arrow buttons
* Changing the value in the input text box
* Dragging the slider

![Demo](./assets/ezgif.com-video-to-gif.gif)

## Contributing

We welcome contributions to the Streamlit Super Slider project. If you'd like to report bugs, request features, or contribute to the code, please [open an issue](https://github.com/fgdvir/streamlit-super-slider/issues) or [submit a pull request](https://github.com/fgdvir/streamlit-super-slider/pulls) on the GitHub repository.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fgdvir/streamlit-super-slider",
    "name": "streamlit-super-slider",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "Python,Streamlit,React,JavaScript",
    "author": "Dvir Itzkovits",
    "author_email": "dvir.itzko@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/8b/0f/d45cb639aebd5654c5d0c8b77efe47b47d2ca08dc63affe2c6c2c7c2e9a9/streamlit-super-slider-0.2.0.tar.gz",
    "platform": null,
    "description": "# streamlit-super-slider\n![](./assets/slider_img.png)\n\n# Streamlit Super Slider\n\nStreamlit Super Slider is a custom component for Streamlit that extends the functionality of the default slider. It provides a more interactive and user-friendly experience with additional features to enhance usability.\n\n## Features\n\n1. Updates Streamlit only on mouse release, not during dragging the mouse.\n2. Includes an input text box attached to the slider where changing the value in either updates the value in the other (input text changes the slider and vice versa).\n3. Arrow buttons to increase/decrease the value by one, providing a \"next\" or \"previous\" button functionality.\n4. Built-in keyboard shortcuts for quick navigation: \",\" (comma) for previous and \".\" (period) for next.\n\n## Installation\n\nYou can install the package via pip:\n\n```pip install streamlit-super-slider```\n\n## Arguments \n\n| Argument       | Type                                    | Description                                                                                                                                         | Default |\n| -------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |\n| `min_value`    | int                                      | Minimum value for the slider.                                                                                                                       | 0       |\n| `max_value`    | int (optional)                           | Maximum value for the slider. Must be specified if `values` is not provided.                                                                        | None    |\n| `default_value`| int (optional)                           | The default value to set the slider to.                                                                                                             | 0       |\n| `values`       | Union[List, Dict[int,str], None] (optional) | By default, the slider will have a range from `min_value` to `max_value`. Specify special set of values through a list or dict.                    | None    |\n| `dots`         | bool (optional)                          | If True, will show dots on the slider for each step.                                                                                                | False   |\n| `steps`        | int (optional)                           | Determines the spacing between the dots.                                                                                                            | None    |\n| `key`          | Any (optional)                           | Streamlit key for the component.                                                                                                                    | None    |\n\n## Usage\n\nTo use the Streamlit Super Slider in your Streamlit app, you simply need to import it and use the `st_slider` function:\n\n```python\nimport streamlit as st\nfrom streamlit_super_slider import st_slider\n\nst.title(\"Streamlit Super Slider Example\")\n\nmin_value = 0\nmax_value = 100\ndefault_value = 50\n\n# Use the Streamlit Super Slider component\nslider_value = st_slider(min_value, max_value, default_value)\n\nst.write(\"Slider with range\")\nvalue = st_slider(values={0: \"zero\", 10:'10', 25:'25', max_value: \"max\"}, key=\"my_slider2\" ,dots=False)\nst.write(\"Slider custom values from dictionary and steps\")\nvalue = st_slider(values={0: \"zero\", 10:'10', 20:'30', 90:'90', max_value: \"max\"}, key=\"my_slider2_steps\" ,dots=False, steps=10)\nst.write(\"Slider custom values from dictionary, steps and dots\")\nvalue = st_slider(values={0: \"zero\", 10:'10', 20:'30', 90:'90', max_value: \"max\"}, key=\"my_slider2_dots_steps\" ,dots=True, steps=10)\nst.write(\"Slider with custom values from list\")\nvalue = st_slider(values=[0,100,350,34560], key=\"my_slider3\")\n\nst.write(f\"Selected value: {slider_value}\")\n```\n\n## Demo\n\nIn the following demo you can see usage of the slider to show images, and all the different ways to chose where to go:\n* Keyboard shortcut\n* Pressing the arrow buttons\n* Changing the value in the input text box\n* Dragging the slider\n\n![Demo](./assets/ezgif.com-video-to-gif.gif)\n\n## Contributing\n\nWe welcome contributions to the Streamlit Super Slider project. If you'd like to report bugs, request features, or contribute to the code, please [open an issue](https://github.com/fgdvir/streamlit-super-slider/issues) or [submit a pull request](https://github.com/fgdvir/streamlit-super-slider/pulls) on the GitHub repository.\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A slider with a lot more features in it than the built in one.",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/fgdvir/streamlit-super-slider"
    },
    "split_keywords": [
        "python",
        "streamlit",
        "react",
        "javascript"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ee6157c9aad4edaac1ae0c7be0c6ec7c13c96644c3ed500552d36111b6501cbc",
                "md5": "a2781ee2f572be8d5110a5e9adaa995f",
                "sha256": "85bb4748fb0212be1190a9f7805176626932b0a10adab1d345eac3a35868aeae"
            },
            "downloads": -1,
            "filename": "streamlit_super_slider-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a2781ee2f572be8d5110a5e9adaa995f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 946698,
            "upload_time": "2023-10-22T13:43:08",
            "upload_time_iso_8601": "2023-10-22T13:43:08.947725Z",
            "url": "https://files.pythonhosted.org/packages/ee/61/57c9aad4edaac1ae0c7be0c6ec7c13c96644c3ed500552d36111b6501cbc/streamlit_super_slider-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b0fd45cb639aebd5654c5d0c8b77efe47b47d2ca08dc63affe2c6c2c7c2e9a9",
                "md5": "e6bbb9d4e881ffe2465807286d2c2f54",
                "sha256": "96dd0576227163c2157f3ac32b9023cb382251dd960bed0d0ae8308bcd1f6507"
            },
            "downloads": -1,
            "filename": "streamlit-super-slider-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e6bbb9d4e881ffe2465807286d2c2f54",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 194090,
            "upload_time": "2023-10-22T13:43:11",
            "upload_time_iso_8601": "2023-10-22T13:43:11.485502Z",
            "url": "https://files.pythonhosted.org/packages/8b/0f/d45cb639aebd5654c5d0c8b77efe47b47d2ca08dc63affe2c6c2c7c2e9a9/streamlit-super-slider-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-22 13:43:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fgdvir",
    "github_project": "streamlit-super-slider",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "streamlit-super-slider"
}
        
Elapsed time: 0.14670s