if (interactive()) {
library("shiny")
library("shinyWidgets")
ui <- fluidPage(
br(),
actionGroupButtons(
inputIds = c("btn1", "btn2", "btn3"),
labels = list("Action 1", "Action 2", tags$span(icon("gear"), "Action 3")),
status = "primary"
),
verbatimTextOutput(outputId = "res1"),
verbatimTextOutput(outputId = "res2"),
verbatimTextOutput(outputId = "res3")
)
server <- function(input, output, session) {
output$res1 <- renderPrint(input$btn1)
output$res2 <- renderPrint(input$btn2)
output$res3 <- renderPrint(input$btn3)
}
shinyApp(ui = ui, server = server)
}
Run the code above in your browser using DataLab