{"id":14970833,"url":"https://github.com/shruagarwal/streamlit-custom-toggle","last_synced_at":"2025-10-26T13:31:29.339Z","repository":{"id":62057040,"uuid":"557308600","full_name":"ShruAgarwal/streamlit-custom-toggle","owner":"ShruAgarwal","description":"Insert heart-shaped Toggle Switch within Streamlit apps! 🧡","archived":false,"fork":false,"pushed_at":"2023-02-27T11:56:25.000Z","size":1498,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T04:41:58.242Z","etag":null,"topics":["accessible","python","react","streamlit","streamlit-component","toggle-switch","typescript"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShruAgarwal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-25T13:04:43.000Z","updated_at":"2024-05-04T09:18:19.000Z","dependencies_parsed_at":"2023-01-23T18:16:06.930Z","dependency_job_id":null,"html_url":"https://github.com/ShruAgarwal/streamlit-custom-toggle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShruAgarwal%2Fstreamlit-custom-toggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShruAgarwal%2Fstreamlit-custom-toggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShruAgarwal%2Fstreamlit-custom-toggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShruAgarwal%2Fstreamlit-custom-toggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShruAgarwal","download_url":"https://codeload.github.com/ShruAgarwal/streamlit-custom-toggle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219862885,"owners_count":16555951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accessible","python","react","streamlit","streamlit-component","toggle-switch","typescript"],"created_at":"2024-09-24T13:44:12.808Z","updated_at":"2025-10-26T13:31:28.336Z","avatar_url":"https://github.com/ShruAgarwal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![streamlit-custom-toggle](https://socialify.git.ci/ShruAgarwal/streamlit-custom-toggle/image?description=1\u0026font=Rokkitt\u0026forks=1\u0026language=1\u0026logo=https%3A%2F%2Fimg.icons8.com%2Fplasticine%2F256%2Freact.png\u0026name=1\u0026owner=1\u0026pattern=Charlie%20Brown\u0026stargazers=1\u0026theme=Light)\n\n\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://pypi.org/project/streamlit-custom-toggle/0.1.1/\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/v/streamlit-custom-toggle?color=brightgreen\" /\u003e\n \u003c/a\u003e\n \u003ca href=\"https://github.com/ShruAgarwal/streamlit-custom-toggle/\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/last-commit/ShruAgarwal/streamlit-custom-toggle?style=flat\u0026logo=git\u0026color=purple\" /\u003e\n \u003c/a\u003e\n \u003ca href=\"https://github.com/ShruAgarwal/streamlit-custom-toggle/blob/main/LICENSE\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-orange.svg\" /\u003e\n \u003c/a\u003e\n \u003ca href=\"https://github.com/ShruAgarwal/streamlit-custom-toggle/\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/languages/code-size/ShruAgarwal/streamlit-custom-toggle?logo=github\u0026style=flat\" /\u003e\n \u003c/a\u003e\n \u003ca href=\"https://pypi.org/project/streamlit-custom-toggle/\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/dm/streamlit-custom-toggle?color=pink\" /\u003e\n \u003c/a\u003e\n\u003c/p\u003e\n\n⚡ A custom component that can load heart-shaped Toggle Switch inside your Streamlit apps.  Also, you can **sync this toggle with different Streamlit widgets!**\n\n\n## Demo 🕹\n[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://shru-examples.streamlit.app/Heart_Toggle_Switch)\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/ShruAgarwal/streamlit-custom-toggle/blob/main/toggle_demo.gif\"/\u003e\n\u003c/p\u003e\n\n## Installation ⬇\n\nFirst `pip install streamlit`. Don't know how? 👉 [Check here!](https://30days.streamlit.app/?challenge=Day+1)\n\nAfter that, install this component:\n\n```\npip install streamlit-custom-toggle\n```\n\n## How to Use? 🤓\n\n*Here's an example code 👇*\n\n```python\nimport streamlit as st\nfrom streamlit_custom_toggle import st_custom_toggle\n\nst.subheader('Music Choices 🎵')\ncol1, col2, col3 = st.columns(3, gap=\"small\")\n\nwith col1:\n    # Disabled toggle switch\n    calm = st_custom_toggle('Calm', active_track_fill=\"#EAE4E4\", active_thumb_color=\"#EAE4E4\", value=\"true\", key=\"toggle1\")\n\nwith col2:\n    fun = st_custom_toggle('Fun', active_track_fill=\"#57FD6E\", active_thumb_color=\"#EAE4E4\", key=\"toggle2\")\n\nwith col3:\n    music_toggle = st_custom_toggle('Rock', active_track_fill=\"#FF5733\", active_thumb_color=\"#900C3F\", key=\"toggle3\")\n    \n    music = st.radio(\n    \"Select your favorite artist\",\n    ('The Beatles', 'AC/DC', 'Pink Floyd', 'Elvis Presley', 'MÃ¥neskin'), disabled=music_toggle)\n    st.markdown(f\"You choose {music}\")\n\n# Checking the toggle state\nst.code(f\"Calm = {calm}, Fun = {fun}, Rock = {music_toggle}\")\n```\n\n\n## Arguments Config ⚙\nIt supports the following arguments customization:\n\n| Args                          | Type   | Required | Description                                                                                              |\n| ----------------------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------- |\n| label                         | string |   YES    | Define the toggle with a short label value\n| active_track_fill             | string |   YES    | Changes the color of the track when the toggle is in the active/on state. Default value is: `#ff708f`\n| active_thumb_color            | string |   YES    | Changes the color of the thumb when the toggle is in the active/on state. Default value is: `#ffffff`\n| value                         | bool   | OPTIONAL | If it's value is set to `true`, then the toggle switch is deactivated. **The toggle is activated by default**\n| key                           | string |   YES    | An optional key value that uniquely identifies this component.\n\n\n## Tech Stack 🧰\n\u003cp align=\"left\"\u003e\n \u003cimg src=\"https://streamlit.io/images/brand/streamlit-mark-color.png\" width=\"50\" /\u003e\n \u003cimg src=\"https://img.icons8.com/plasticine/256/react.png\" width=\"50\" alt=\"React\" /\u003e\n \u003cimg src=\"https://img.icons8.com/color/256/python.png\" width=\"50\" /\u003e\n \u003cimg src=\"https://img.icons8.com/color/256/typescript.png\" width=\"50\" /\u003e\n \u003cimg src=\"https://img.icons8.com/color/256/nodejs.png\" width=\"50\" /\u003e\n \u003cimg src=\"https://files.anaconda.com/production/resources/open-source/conda-artboard.svg\" width=\"80\" /\u003e\n\u003c/p\u003e\n\n\n## Workflow 👀\nHere's the blueprint on how my component works. For understanding it in details, 👉 **[Read here please!](https://shru.hashnode.dev/dont-let-those-bugs-slow-you-down#heading-final-code-blueprint)**\n\n\u003cimg src=\"https://cdn.hashnode.com/res/hashnode/image/upload/v1677245116395/823a8c42-4ceb-4d9a-92e3-a02a3b72f240.png\" /\u003e\n\n\n## License 📝\nThis software is open source, licensed under the [MIT License.](https://github.com/ShruAgarwal/streamlit-custom-toggle/blob/main/LICENSE)\n\n## Helpful References 🤩\n\n- [React heart-switch](https://github.com/anatoliygatt/heart-switch)\n- [Streamlit Components Tutorial by FANILO](https://streamlit-components-tutorial.netlify.app/)\n- [Streamlit Component Publish Docs](https://docs.streamlit.io/library/components/publish)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshruagarwal%2Fstreamlit-custom-toggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshruagarwal%2Fstreamlit-custom-toggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshruagarwal%2Fstreamlit-custom-toggle/lists"}