update_calcite | R Documentation |
Updates the properties of the javascript Calcite component.
update_calcite(id, ..., session = shiny::getDefaultReactiveDomain())
id |
the html ID of the element to update. Must be a character scalar. |
... |
named properties to be updated in the component. The names must match the property name. Otherwise, will fail silently. |
session |
a shiny session object. Default |
NULL. Sends a message to the shiny session object.
# this cannot work outside of shiny
if (interactive()) {
library(shiny)
ui <- calcite_shell(
calcite_card(
heading = "Content",
calcite_label(
layout = "inline",
calcite_checkbox(id = "checked"),
"Click me"
)
),
calcite_notice(
id = "initial-note",
div(slot = "title", "Nice!"),
div(slot = "message", "This is a success message")
)
)
server <- function(input, output, session) {
observeEvent(input$checked_checked, {
checked <- input$checked_checked$values
# Update the `initial-note` property here
update_calcite("initial-note", open = checked)
})
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.