downloadButtons: Action Buttons and Links

Description Usage Arguments Author(s) See Also Examples

Description

Create action buttons in tabular input panels.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
downloadButton_cell(
  outputId,
  label = "Download",
  class = NULL,
  leftLabel = TRUE,
  labelButton = TRUE,
  disabled = FALSE,
  hidden = FALSE
)

downloadButton_row(
  outputId,
  label = "Download",
  class = NULL,
  leftLabel = TRUE,
  labelButton = TRUE,
  disabled = FALSE,
  hidden = FALSE
)

Arguments

label

The contents of the button or link-usually a text label, but you could also use any other HTML, like an image.

class

Additional CSS classes to apply to the tag, if any. Currently not implemented.

leftLabel

Should the label column be the left column or the right column. TRUE puts the label on the left column. This only takes effect when labelButton = FALSE.

labelButton

Should the label be placed on the button? If FALSE, the label text appears to the side of the button and the button itself is blank.

inputId

The input slot that will be used to access the value.

Author(s)

Benjamin Nutter

See Also

downloadButton

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
## Not run: 
options(pixiedust_print_method = "html")

#* Example of Download Buttons
shinyApp(
  ui = shinyUI(
    wellPanel(uiOutput("sampleUI"))
  ),
  
  server = shinyServer(function(input, output){
    output$sampleUI <- 
      renderText({ 
        downloadButton_row(inputId = paste0("car", 1:nrow(mtcars)),
                          label = rownames(mtcars),
                          labelButton = c(TRUE, FALSE)) %>%
                          dust() %>%
                          print(asis = FALSE)
      })
  })
)



#' #* Example of Download Links
shinyApp(
  ui = shinyUI(
    wellPanel(uiOutput("sampleUI"))
  ),
  
  server = shinyServer(function(input, output){
    output$sampleUI <- 
      renderText({ 
        data.frame(
          actionLink = 
            downloadLink_cell(inputId = paste0("car", 1:nrow(mtcars)),
                            label = rownames(mtcars)),
          stringsAsFactors = FALSE) %>%
        dust() %>%
        print(asis = FALSE)
      })
  })
)

## End(Not run)

nutterb/shinydust documentation built on Dec. 6, 2020, 8:13 a.m.