Last active
November 23, 2021 14:20
-
-
Save jrosell/f75cee998a776f572dde9a6141600c8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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