express.ui.update_popover(id, *args, title=None, show=None, session=None)

Update the contents or title of a popover.


id: str

The id of the popover DOM element to update.

*args: TagChild = ()

The new contents of the popover.

title: Optional[TagChild] = None

The new title of the popover.

show: Optional[bool] = None

Opens (True) or closes (False) the popover.

session: Optional[Session] = None

A Shiny session object (the default should almost always be used).

See Also


#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400

## file:
from shiny import reactive
from import input, ui

ui.input_action_button("btn_show", "Show popover", class_="mt-3 me-3")
ui.input_action_button("btn_close", "Close popover", class_="mt-3 me-3")

with ui.popover(id="popover_id"):
    ui.input_action_button("btn_w_popover", "A button w/ a popover", class_="mt-3")
    "A message"

def _():
    ui.update_popover("popover_id", show=True)

def _():
    ui.update_popover("popover_id", show=False)

def _():
    ui.notification_show("Button clicked!", duration=3, type="message")