ui.update_action_link
id, *, label=None, icon=None, session=None) ui.update_action_link(
Change the label and/or icon of an action link on the client.
Parameters
Note
The input updater functions send a message to the client, telling it to change the
settings of an input object. The messages are collected and sent after all the
observers (including outputs) have finished running.
The syntax of these functions is similar to the functions that created the inputs in
the first place. For example, [](:func:`~shiny.ui.input_numeric`) and
[](:func:`~shiny.ui.update_numeric`) take a similar set of arguments.
Any arguments with ``None`` values will be ignored; they will not result in any
changes to the input object on the client.
For [](:func:`~shiny.ui.update_radio_buttons`), [](:func:`~shiny.ui.update_checkbox_group`), and
[](:func:`~shiny.ui.update_select`), the set of choices can be cleared by using ``choices=[]``.
Similarly, for these inputs, the selected item can be cleared by using
`selected=[]`.
See Also
input_action_link
Examples
#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
## file: app.py
from shiny import App, Inputs, Outputs, Session, reactive, req, ui
app_ui = ui.page_fluid(
ui.input_action_button("update", "Update other buttons and link"),
ui.br(),
ui.input_action_button("goButton", "Go"),
ui.br(),
ui.input_action_button("goButton2", "Go 2", icon="🤩"),
ui.br(),
ui.input_action_button("goButton3", "Go 3"),
ui.br(),
ui.input_action_link("goLink", "Go Link"),
)
def server(input: Inputs, output: Outputs, session: Session):
@reactive.effect
def _():
req(input.update())
# Updates goButton's label and icon
ui.update_action_button("goButton", label="New label", icon="📅")
# Leaves goButton2's label unchanged and removes its icon
ui.update_action_button("goButton2", icon=[])
# Leaves goButton3's icon, if it exists, unchanged and changes its label
ui.update_action_button("goButton3", label="New label 3")
# Updates goLink's label and icon
ui.update_action_link("goLink", label="New link label", icon="🔗")
app = App(app_ui, server)