accordion_panel_set {bslib} | R Documentation |
Dynamically update accordions
Description
Dynamically update/modify accordion()
s in a Shiny app. To be updated
programmatically, the accordion()
must have an id
. These functions
require an active Shiny session and only work with a running Shiny app.
Usage
accordion_panel_set(id, values, session = get_current_session())
accordion_panel_open(id, values, session = get_current_session())
accordion_panel_close(id, values, session = get_current_session())
accordion_panel_insert(
id,
panel,
target = NULL,
position = c("after", "before"),
session = get_current_session()
)
accordion_panel_remove(id, target, session = get_current_session())
accordion_panel_update(
id,
target,
...,
title = NULL,
value = NULL,
icon = NULL,
session = get_current_session()
)
Arguments
id |
an character string that matches an existing |
values |
either a character string (used to identify particular
|
session |
a shiny session object (the default should almost always be used). |
panel |
|
target |
The |
position |
Should |
... |
Elements that become the new content of the panel. |
title |
A title to appear in the |
value |
A character string that uniquely identifies this panel. |
icon |
A htmltools::tag child (e.g., |
Functions
-
accordion_panel_set()
: same asaccordion_panel_open()
, except it also closes any currently open panels. -
accordion_panel_open()
: openaccordion_panel()
s. -
accordion_panel_close()
: closeaccordion_panel()
s. -
accordion_panel_insert()
: insert a newaccordion_panel()
-
accordion_panel_remove()
: removeaccordion_panel()
s. -
accordion_panel_update()
: update aaccordion_panel()
.
See Also
accordion()
and accordion_panel()
create the accordion
component.