# NOT RUN {
if (interactive()) {
library(shiny)
library(hover)
ui <- fluidPage(
use_hover(),
hover_download_button(
outputId = "downloadData",
label = "Download",
button_animation = "rotate",
icon_animation = "spin"
)
)
server <- function(input, output) {
# Our dataset
data <- mtcars
output$downloadData <- downloadHandler(
filename = function() {
paste("data-", Sys.Date(), ".csv", sep="")
},
content = function(file) {
write.csv(data, file)
}
)
}
shinyApp(ui, server)
}
# }
Run the code above in your browser using DataLab