express.ui.input_bookmark_button
express.ui.input_bookmark_button(
label='Bookmark...',
*,
icon=MISSING,
width=None,
disabled=False,
id=BOOKMARK_ID,
title="Bookmark this application's state and get a URL for sharing.",
**kwargs,
)Button for bookmarking/sharing.
A bookmark button is an input_action_button with a default label that consists of a link icon and the text "Bookmark...". It is meant to be used for bookmarking state.
Parameters
label : TagChild = 'Bookmark…'-
The button label.
icon : TagChild | MISSING_TYPE = MISSING-
The icon to display on the button.
width : Optional[str] = None-
The CSS width, e.g. ‘400px’, or ‘100%’.
disabled : bool = False-
Whether the button is disabled.
id : str = BOOKMARK_ID-
An ID for the bookmark button. This should only be provided when multiple buttons are needed (or used inside a module). See the note on multiple buttons.
title : str = "Bookmark this application's state and get a URL for sharing."-
A tooltip that is shown when the mouse cursor hovers over the button.
kwargs : TagAttrValue = {}-
Additional attributes for the button.
Returns
: Tag-
A UI element.
See Also
Examples
#| '!! shinylive warning !!': |
#| shinylive does not work in self-contained HTML documents.
#| Please set `embed-resources: false` in your metadata.
#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
## file: app.py
from shiny.express import app_opts, session, ui
app_opts(bookmark_store="url")
ui.markdown(
"Directions: "
"\n1. Change the radio button selection below"
"\n2. Save the bookmark."
"\n3. Then, refresh your browser page to see the radio button selection has been restored."
)
ui.input_radio_buttons("letter", "Choose a letter", choices=["A", "B", "C"])
ui.input_bookmark_button()
@session.bookmark.on_bookmarked
async def _(url: str):
await session.bookmark.update_query_string(url)