Skip to content

Instantly share code, notes, and snippets.

@jrosell
Last active November 23, 2021 14:20
Show Gist options
  • Save jrosell/b263b3b72e4caf0385cac1c7f7d0c4e6 to your computer and use it in GitHub Desktop.
Save jrosell/b263b3b72e4caf0385cac1c7f7d0c4e6 to your computer and use it in GitHub Desktop.
library(shiny)
library(shinyjs)
ui <- fluidPage(
useShinyjs(),
titlePanel("Shiny JavaScript"),
actionButton(
"javascript_update",
label = "Utilitzo javascript",
icon = icon("arrow-up")
),
actionButton(
"click_button",
label = "Actualitza botó",
onclick = "
$('#javascript_update > i').toggleClass('fa-arrow-up');
$('#javascript_update > i').toggleClass('fa-arrow-down');
"
)
)
server <- function(input, output, session) {}
shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment