express.ui.modal_show
=None) express.ui.modal_show(modal, session
Show a modal dialog.
modal_show
is used to display a modal that has been created with modal
.
Parameters
modal : Tag
-
Typically a
modal
instance. session : Optional[
Session
] = None-
The
Session
instance to display the modal in. If not provided, the session is inferred viaget_current_session
.
See Also
Examples
#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
## file: app.py
from shiny import reactive
from shiny.express import input, ui
ui.input_action_button("show", "Show modal dialog")
@reactive.effect
@reactive.event(input.show)
def _():
m = ui.modal(
"This is a somewhat important message.",
title="Somewhat important message",
easy_close=True,
footer=None,
)
ui.modal_show(m)