-
Notifications
You must be signed in to change notification settings - Fork 114
Closed
Labels
Description
panel_title()
is missing from Shiny Express. Its usage is partially covered by shiny.ui.page_opts()
, which exposes title
(but not window_title
) and passes title
to page functions that take the argument.
I think that, for consistency, we should offer shiny.express.ui.panel_title()
. Secondarily, we can augment shiny.express.ui.page_opts()
to take window_title
and to also, possibly, insert title
into the older page functions like page_fluid()
.
panel_title()
takes two arguments, title
and window_title
. When provided by the user, window_title
is always static, but title
could be a simple static value or it could involve dynamic UI:
from shiny import render
from shiny.express import input, ui
# Static title option ----
# ui.panel_title(title="Page title", window_title="Window title")
# Dynamic title option ----
with ui.panel_title(window_title="Static window title"):
@render.ui
def page_title():
page = input.page() if "page" in input else "Home"
return ui.h2(f"{page} title")
ui.input_select("page", "Page", ["Home", "About", "Contact"])