Skip to content

Instantly share code, notes, and snippets.

@jrosell
Last active November 23, 2021 14:20
Show Gist options
  • Save jrosell/f75cee998a776f572dde9a6141600c8e to your computer and use it in GitHub Desktop.
Save jrosell/f75cee998a776f572dde9a6141600c8e to your computer and use it in GitHub Desktop.
library(shiny)
ui <- fluidPage(
titlePanel("Shiny Server"),
uiOutput("server_update"),
actionButton(
"click_button",
label = "Actualitza botó"
)
)
server <- function(input, output, session) {
output$server_update <- renderUI({
clicks <- input$click_button
icon_status_up <-
is.null(clicks) || clicks %% 2 == 0
icon_name <- if(icon_status_up) {
"arrow-up"
} else {
"arrow-down"
}
actionButton(
"server_update",
label = "Utilitzo reactivitat del servidor",
icon = icon(icon_name)
)
})
}
shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment