
Create a large button ideal for web applications but identical to the classic Shiny action button.
appButton(..., inputId, label, icon = NULL, width = NULL, color = NULL)
Named attributes to be applied to the button or link.
The input
slot that will be used to access the value.
The contents of the button or link--usually a text label, but you could also use any other HTML, like an image.
An optional icon()
to appear on the button.
The width of the input, e.g. '400px'
, or '100%'
;
see validateCssUnit()
.
Button backgroun color. Valid statuses are defined as follows:
primary
: bs4Dash:::rd_color_tag("#007bff").
secondary
: bs4Dash:::rd_color_tag("#6c757d").
info
: bs4Dash:::rd_color_tag("#17a2b8").
success
: bs4Dash:::rd_color_tag("#28a745").
warning
: bs4Dash:::rd_color_tag("#ffc107").
danger
: bs4Dash:::rd_color_tag("#dc3545").
gray-dark
: bs4Dash:::rd_color_tag("#343a40").
gray
: bs4Dash:::rd_color_tag("#adb5bd").
white
: bs4Dash:::rd_color_tag("#fff").
indigo
: bs4Dash:::rd_color_tag("#6610f2").
lightblue
: bs4Dash:::rd_color_tag("#3c8dbc").
navy
: bs4Dash:::rd_color_tag("#001f3f").
purple
: bs4Dash:::rd_color_tag("#605ca8").
fuchsia
: bs4Dash:::rd_color_tag("#f012be").
pink
: bs4Dash:::rd_color_tag("#e83e8c").
maroon
: bs4Dash:::rd_color_tag("#d81b60").
orange
: bs4Dash:::rd_color_tag("#ff851b").
lime
: bs4Dash:::rd_color_tag("#01ff70").
teal
: bs4Dash:::rd_color_tag("#39cccc").
olive
: bs4Dash:::rd_color_tag("#3d9970").
David Granjon, dgranjon@ymail.com
if (interactive()) {
library(shiny)
library(bs4Dash)
shinyApp(
ui = dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
box(
title = "App Buttons",
status = NULL,
appButton(
inputId = "myAppButton",
label = "Users",
icon = icon("users"),
color = "orange",
dashboardBadge(textOutput("btnVal"), color = "primary")
)
)
),
title = "App buttons"
),
server = function(input, output) {
output$btnVal <- renderText(input$myAppButton)
}
)
}
Run the code above in your browser using DataLab