hover_download_button: Download button with button and icon animations

Description Usage Arguments Source Examples

View source: R/hover_download_button.R

Description

Animate a downloadButton and it's icon using Hover.css

Usage

1
2
3
4
5
6
7
8
hover_download_button(
  outputId,
  label = "Download",
  button_animation = NULL,
  icon_animation = NULL,
  class = NULL,
  ...
)

Arguments

outputId

The name of the output slot that the downloadHandler is assigned to.

label

The label that should appear on the button.

button_animation

The name of the button animation.

icon_animation

The name of the icon animation.

class

Additional CSS classes to apply to the tag, if any.

...

Other arguments to pass to the container tag function.

Source

https://github.com/IanLunn/Hover

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)
}

hover documentation built on March 21, 2021, 1:06 a.m.