Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

downloadBttn

Create a download actionBttn


Description

Create a download button with actionBttn.

Usage

downloadBttn(
  outputId,
  label = "Download",
  style = "unite",
  color = "primary",
  size = "md",
  block = FALSE,
  no_outline = TRUE
)

Arguments

outputId

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

label

The label that should appear on the button.

style

Style of the button, to choose between simple, bordered, minimal, stretch, jelly, gradient, fill, material-circle, material-flat, pill, float, unite.

color

Color of the button : default, primary, warning, danger, success, royal.

size

Size of the button : xs,sm, md, lg.

block

Logical, full width button.

no_outline

Logical, don't show outline when navigating with keyboard/interact using mouse or touch.

Examples

if (interactive()) {

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  tags$h2("Download bttn"),
  downloadBttn(
    outputId = "downloadData",
    style = "bordered",
    color = "primary"
  )
)

server <- function(input, output, session) {

  output$downloadData <- downloadHandler(
    filename = function() {
      paste('data-', Sys.Date(), '.csv', sep='')
    },
    content = function(con) {
      write.csv(mtcars, con)
    }
  )

}

shinyApp(ui, server)

}

shinyWidgets

Custom Inputs Widgets for Shiny

v0.6.0
GPL-3
Authors
Victor Perrier [aut, cre, cph], Fanny Meyer [aut], David Granjon [aut], Ian Fellows [ctb] (Methods for mutating vertical tabs & updateMultiInput), Wil Davis [ctb] (numericRangeInput function), Spencer Matthews [ctb] (autoNumeric methods), JavaScript and CSS libraries authors [ctb, cph] (All authors are listed in LICENSE.md)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.