streamlit-modal


Namestreamlit-modal JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/teamtv/streamlit_modal
SummaryModal for streamlit
upload_time2024-01-26 08:26:57
maintainer
docs_urlNone
authorKoen Vossen
requires_python
licenseBSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Streamlit modal

Modal support for streamlit. The hackish way.

## Example

```python
import streamlit as st
from streamlit_modal import Modal

import streamlit.components.v1 as components


modal = Modal(
    "Demo Modal", 
    key="demo-modal",
    
    # Optional
    padding=20,    # default value
    max_width=744  # default value
)
open_modal = st.button("Open")
if open_modal:
    modal.open()

if modal.is_open():
    with modal.container():
        st.write("Text goes here")

        html_string = '''
        <h1>HTML string in RED</h1>

        <script language="javascript">
          document.querySelector("h1").style.color = "red";
        </script>
        '''
        components.html(html_string)

        st.write("Some fancy text")
        value = st.checkbox("Check me")
        st.write(f"Checkbox checked: {value}")
```

## Install

```shell script
pip install streamlit-modal
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/teamtv/streamlit_modal",
    "name": "streamlit-modal",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Koen Vossen",
    "author_email": "info@koenvossen.nl",
    "download_url": "https://files.pythonhosted.org/packages/73/d0/57f660b6f4abfae92973f2cd0e67fa851dc6df3c4d99ab1a36cd1e5782f4/streamlit_modal-0.1.1.tar.gz",
    "platform": null,
    "description": "# Streamlit modal\n\nModal support for streamlit. The hackish way.\n\n## Example\n\n```python\nimport streamlit as st\nfrom streamlit_modal import Modal\n\nimport streamlit.components.v1 as components\n\n\nmodal = Modal(\n    \"Demo Modal\", \n    key=\"demo-modal\",\n    \n    # Optional\n    padding=20,    # default value\n    max_width=744  # default value\n)\nopen_modal = st.button(\"Open\")\nif open_modal:\n    modal.open()\n\nif modal.is_open():\n    with modal.container():\n        st.write(\"Text goes here\")\n\n        html_string = '''\n        <h1>HTML string in RED</h1>\n\n        <script language=\"javascript\">\n          document.querySelector(\"h1\").style.color = \"red\";\n        </script>\n        '''\n        components.html(html_string)\n\n        st.write(\"Some fancy text\")\n        value = st.checkbox(\"Check me\")\n        st.write(f\"Checkbox checked: {value}\")\n```\n\n## Install\n\n```shell script\npip install streamlit-modal\n```\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Modal for streamlit",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/teamtv/streamlit_modal"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8cb2151c3dfc9c1e5fc1b7969d91f05d8d939c79c935c116f4c7f3a6a3869fd",
                "md5": "257bdd7e81e43adb5d610b9788718430",
                "sha256": "3492a901b3917fa5b497c26b5f93271bde6828282ff887f6d7249c6ce963fb97"
            },
            "downloads": -1,
            "filename": "streamlit_modal-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "257bdd7e81e43adb5d610b9788718430",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4575,
            "upload_time": "2024-01-26T08:26:54",
            "upload_time_iso_8601": "2024-01-26T08:26:54.874604Z",
            "url": "https://files.pythonhosted.org/packages/e8/cb/2151c3dfc9c1e5fc1b7969d91f05d8d939c79c935c116f4c7f3a6a3869fd/streamlit_modal-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73d057f660b6f4abfae92973f2cd0e67fa851dc6df3c4d99ab1a36cd1e5782f4",
                "md5": "f82fcaff54a3250057aa719a92bce013",
                "sha256": "fd31537a5a52d9c5f4b1ed5b8981fb111f98051a95358161664fc9e86b7d9529"
            },
            "downloads": -1,
            "filename": "streamlit_modal-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f82fcaff54a3250057aa719a92bce013",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4316,
            "upload_time": "2024-01-26T08:26:57",
            "upload_time_iso_8601": "2024-01-26T08:26:57.500572Z",
            "url": "https://files.pythonhosted.org/packages/73/d0/57f660b6f4abfae92973f2cd0e67fa851dc6df3c4d99ab1a36cd1e5782f4/streamlit_modal-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-26 08:26:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "teamtv",
    "github_project": "streamlit_modal",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "streamlit-modal"
}
        
Elapsed time: 0.20367s