st-mui-dialog


Namest-mui-dialog JSON
Version 0.0.10 PyPI version JSON
download
home_page
SummaryStreamlit Component for MUI Dialogs
upload_time2022-12-30 13:54:50
maintainer
docs_urlNone
author
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Streamlit MUI Dialog Component
===

This streamlit component adds a Dialog (Modal) with two buttons to Streamlit Apps. 

It implements the MUI Alert Dialog: https://mui.com/material-ui/react-dialog/

Installation
-----------

    $ pip install st-mui-dialog


Usage
------------

### Import the Component

    $ from st_mui_dialog import st_mui_dialog

### Initialize an instant

    $ answer = st_mui_dialog(title="Confirmation", content="Please confirm that you want to save the changes")


![Example](images\image1.png)

### Configuration Options

#### Button Labels

    #Open Button Label
    st_mui_dialog(..., button_txt = "Open the Dialog")
    
    #Abort Button Label
    st_mui_dialog(..., abortlabel = "DISAGREE")

    #Agree Button Label
    st_mui_dialog(..., abortlabel = "AGREE")

#### Styling

##### Dividers

    st_mui_dialog(..., divider = True)

![Example](images\image2.png)

##### Open the Dialog in Fullscreen (whole iFrame)
    #The open button will be hidden

    st_mui_dialog(..., fullscreen = True)

![Example](images\image3.png)

##### Transition Modes 

Currently not working

    st_mui_dialog(..., transition_mode = "zoom")

    #if the transition mode is 'slide' the paramater 'slide_direction' is needed
    st_mui_dialog(..., transition_mode = "slide", slide_direction = "up")

##### Width of the Dialog
The width is always limited to the widht of the iframe

    #Sets the max width to "xl"
    st_mui_dialog(..., width_dialog = "xl")

    #Always shows the max width of the dialog - If false the width will be dependent on the content.
    st_mui_dialog(..., adapt_width_dialog = True)

##### Button Styles

    #Button Types

    #Open Button
    st_mui_dialog(..., button_open_type = "primary")

    #Agree Button
    st_mui_dialog(..., button_agree_type = "warning")

    #Abort Button
    st_mui_dialog(..., button_abort_type = "success")


##### CSS Styles

It is possible to apply CSS Styles to the different MUI Elements of the Dialog

    st_mui_dialog(..., styling_dialog = """{"& .MuiModal-backdrop": {"backgroundColor": "red"},"& .MuiModal-container":{"backgroundColor" :"red"}""")
    st_mui_dialog(..., styling_open_button = """{"backgroundColor" :"lightgreen"}""")
    st_mui_dialog(..., styling_agree_button = """{"backgroundColor" :"yellow"}"""")
    st_mui_dialog(..., styling_abort_button = """{"backgroundColor" :"blue"}""")
    st_mui_dialog(..., styling_dialog_content = """{"backgroundColor" :"blue"}""")
    st_mui_dialog(..., styling_dialog_title = """{"backgroundColor" :"blue"}""")
    st_mui_dialog(..., styling_dialog_content_text = """{"backgroundColor" :"blue"}""")

##### Event Handlers

It is possible to execute JavaScript commands on Open, Close, Agree and Abort. 

    st_mui_dialog(..., on_open = """console.log("Open")""")
    st_mui_dialog(..., on_close = """console.log("Close")""")
    st_mui_dialog(..., on_agree = """console.log("Agree")""")
    st_mui_dialog(..., on_abort = """console.log("Abort")""")







            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "st-mui-dialog",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/c1/dd/347bbde1a04d9fdcdb2e6c46e08c02dc5e87509bcce2b1e8fa99b12b0337/st_mui_dialog-0.0.10.tar.gz",
    "platform": null,
    "description": "Streamlit MUI Dialog Component\r\n===\r\n\r\nThis streamlit component adds a Dialog (Modal) with two buttons to Streamlit Apps. \r\n\r\nIt implements the MUI Alert Dialog: https://mui.com/material-ui/react-dialog/\r\n\r\nInstallation\r\n-----------\r\n\r\n    $ pip install st-mui-dialog\r\n\r\n\r\nUsage\r\n------------\r\n\r\n### Import the Component\r\n\r\n    $ from st_mui_dialog import st_mui_dialog\r\n\r\n### Initialize an instant\r\n\r\n    $ answer = st_mui_dialog(title=\"Confirmation\", content=\"Please confirm that you want to save the changes\")\r\n\r\n\r\n![Example](images\\image1.png)\r\n\r\n### Configuration Options\r\n\r\n#### Button Labels\r\n\r\n    #Open Button Label\r\n    st_mui_dialog(..., button_txt = \"Open the Dialog\")\r\n    \r\n    #Abort Button Label\r\n    st_mui_dialog(..., abortlabel = \"DISAGREE\")\r\n\r\n    #Agree Button Label\r\n    st_mui_dialog(..., abortlabel = \"AGREE\")\r\n\r\n#### Styling\r\n\r\n##### Dividers\r\n\r\n    st_mui_dialog(..., divider = True)\r\n\r\n![Example](images\\image2.png)\r\n\r\n##### Open the Dialog in Fullscreen (whole iFrame)\r\n    #The open button will be hidden\r\n\r\n    st_mui_dialog(..., fullscreen = True)\r\n\r\n![Example](images\\image3.png)\r\n\r\n##### Transition Modes \r\n\r\nCurrently not working\r\n\r\n    st_mui_dialog(..., transition_mode = \"zoom\")\r\n\r\n    #if the transition mode is 'slide' the paramater 'slide_direction' is needed\r\n    st_mui_dialog(..., transition_mode = \"slide\", slide_direction = \"up\")\r\n\r\n##### Width of the Dialog\r\nThe width is always limited to the widht of the iframe\r\n\r\n    #Sets the max width to \"xl\"\r\n    st_mui_dialog(..., width_dialog = \"xl\")\r\n\r\n    #Always shows the max width of the dialog - If false the width will be dependent on the content.\r\n    st_mui_dialog(..., adapt_width_dialog = True)\r\n\r\n##### Button Styles\r\n\r\n    #Button Types\r\n\r\n    #Open Button\r\n    st_mui_dialog(..., button_open_type = \"primary\")\r\n\r\n    #Agree Button\r\n    st_mui_dialog(..., button_agree_type = \"warning\")\r\n\r\n    #Abort Button\r\n    st_mui_dialog(..., button_abort_type = \"success\")\r\n\r\n\r\n##### CSS Styles\r\n\r\nIt is possible to apply CSS Styles to the different MUI Elements of the Dialog\r\n\r\n    st_mui_dialog(..., styling_dialog = \"\"\"{\"& .MuiModal-backdrop\": {\"backgroundColor\": \"red\"},\"& .MuiModal-container\":{\"backgroundColor\" :\"red\"}\"\"\")\r\n    st_mui_dialog(..., styling_open_button = \"\"\"{\"backgroundColor\" :\"lightgreen\"}\"\"\")\r\n    st_mui_dialog(..., styling_agree_button = \"\"\"{\"backgroundColor\" :\"yellow\"}\"\"\"\")\r\n    st_mui_dialog(..., styling_abort_button = \"\"\"{\"backgroundColor\" :\"blue\"}\"\"\")\r\n    st_mui_dialog(..., styling_dialog_content = \"\"\"{\"backgroundColor\" :\"blue\"}\"\"\")\r\n    st_mui_dialog(..., styling_dialog_title = \"\"\"{\"backgroundColor\" :\"blue\"}\"\"\")\r\n    st_mui_dialog(..., styling_dialog_content_text = \"\"\"{\"backgroundColor\" :\"blue\"}\"\"\")\r\n\r\n##### Event Handlers\r\n\r\nIt is possible to execute JavaScript commands on Open, Close, Agree and Abort. \r\n\r\n    st_mui_dialog(..., on_open = \"\"\"console.log(\"Open\")\"\"\")\r\n    st_mui_dialog(..., on_close = \"\"\"console.log(\"Close\")\"\"\")\r\n    st_mui_dialog(..., on_agree = \"\"\"console.log(\"Agree\")\"\"\")\r\n    st_mui_dialog(..., on_abort = \"\"\"console.log(\"Abort\")\"\"\")\r\n\r\n\r\n\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Streamlit Component for MUI Dialogs",
    "version": "0.0.10",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "920a666f8386914574877180cf4d1d5c",
                "sha256": "ddbcf582c99e01c63279049520653414d280f90f8da2f669b3f27de0f5023eab"
            },
            "downloads": -1,
            "filename": "st_mui_dialog-0.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "920a666f8386914574877180cf4d1d5c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 1378154,
            "upload_time": "2022-12-30T13:54:44",
            "upload_time_iso_8601": "2022-12-30T13:54:44.537288Z",
            "url": "https://files.pythonhosted.org/packages/82/de/937204f93eeaa1f293b8710edd3dc58489f8d94c561a5c42bf948bc7cd53/st_mui_dialog-0.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "be82ac0fe16669ce24c6333bd5421d9d",
                "sha256": "889f7a8b47f10a1a56d0e74119bc976d3fbf2b273c3657121364a403708e510d"
            },
            "downloads": -1,
            "filename": "st_mui_dialog-0.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "be82ac0fe16669ce24c6333bd5421d9d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 701995,
            "upload_time": "2022-12-30T13:54:50",
            "upload_time_iso_8601": "2022-12-30T13:54:50.277386Z",
            "url": "https://files.pythonhosted.org/packages/c1/dd/347bbde1a04d9fdcdb2e6c46e08c02dc5e87509bcce2b1e8fa99b12b0337/st_mui_dialog-0.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-30 13:54:50",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "st-mui-dialog"
}
        
Elapsed time: 5.96141s