actionButtons: 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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
actionButton_cell(
  inputId,
  label,
  icon = NULL,
  width = "",
  leftLabel = TRUE,
  labelButton = TRUE,
  disabled = FALSE,
  hidden = FALSE,
  style = "",
  ...
)

actionButton_row(
  inputId,
  label,
  icon = NULL,
  width = "",
  leftLabel = TRUE,
  labelButton = TRUE,
  disabled = FALSE,
  hidden = FALSE,
  ...
)

actionLink_cell(
  inputId,
  label,
  icon = NULL,
  disabled = FALSE,
  hidden = FALSE,
  ...
)

downloadLink_cell(outputId, label, disabled = FALSE, hidden = FALSE)

Arguments

inputId

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

label

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

icon

An option icon to appear on the button. Currently ignored.

width

The width of the input, e.g. '400px' or '100%'.

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.

...

Named attributes to be applied to the button or link. Not yet implemented.

Author(s)

Benjamin Nutter

See Also

actionButton

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
45
## Not run: 
options(pixiedust_print_method = "html")

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

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

## End(Not run)

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