Create a large button ideal for web applications but identical to the classic Shiny action button.
Arguments
- ...
Named attributes to be applied to the button or link.
- inputId
The
inputslot 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 optional
icon()to appear on the button.- width
The width of the input, e.g.
'400px', or'100%'; seevalidateCssUnit().- color
Button backgroun color. Valid statuses are defined as follows:
primary: #007bff .secondary: #6c757d .info: #17a2b8 .success: #28a745 .warning: #ffc107 .danger: #dc3545 .gray-dark: #343a40 .gray: #adb5bd .white: #fff .indigo: #6610f2 .lightblue: #3c8dbc .navy: #001f3f .purple: #605ca8 .fuchsia: #f012be .pink: #e83e8c .maroon: #d81b60 .orange: #ff851b .lime: #01ff70 .teal: #39cccc .olive: #3d9970 .
Author
David Granjon, dgranjon@ymail.com
Examples
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)
}
)
}
