actionBttn: Awesome action button

Description Usage Arguments See Also Examples

View source: R/actionBttn.R

Description

Like actionButton but awesome, via https://bttn.surge.sh/

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
actionBttn(
  inputId,
  label = NULL,
  icon = NULL,
  style = "unite",
  color = "default",
  size = "md",
  block = FALSE,
  no_outline = TRUE
)

Arguments

inputId

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

label

The contents of the button, usually a text label.

icon

An optional icon to 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.

See Also

downloadBttn

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
if (interactive()) {

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  tags$h2("Awesome action button"),
  tags$br(),
  actionBttn(
    inputId = "bttn1",
    label = "Go!",
    color = "primary",
    style = "bordered"
  ),
  tags$br(),
  verbatimTextOutput(outputId = "res_bttn1"),
  tags$br(),
  actionBttn(
    inputId = "bttn2",
    label = "Go!",
    color = "success",
    style = "material-flat",
    icon = icon("sliders"),
    block = TRUE
  ),
  tags$br(),
  verbatimTextOutput(outputId = "res_bttn2")
)

server <- function(input, output, session) {
  output$res_bttn1 <- renderPrint(input$bttn1)
  output$res_bttn2 <- renderPrint(input$bttn2)
}

shinyApp(ui = ui, server = server)

}

Example output



shinyWidgets documentation built on Sept. 17, 2021, 5:06 p.m.