This is most probably a radioButtons element styled with CSS. Here is an example how to apply this kind of formatting to radio buttons: https://stackoverflow.com/a/4642152/14327549
With package shinyWidgets and a bit of CSS you can achieve the same result:
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
tags$h1("Active background color for radioGroupButtons"),
tags$style(
".btn-custom.active, .btn-custom:active, .btn-custom:focus, .btn-custom:hover {
background: #4B088A !important;
color: #FFF !important;
}",
".btn-custom {border-color: #4B088A; color: #4B088A; background: #FFF;}"
),
radioGroupButtons(
inputId = "somevalue",
label = NULL,
choices = c("All cases", "Active cases"),
status = "custom"
),
verbatimTextOutput("value")
)
server <- function(input, output) {
output$value <- renderPrint({ input$somevalue })
}
shinyApp(ui, server)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.