An LCARS styled toggle button that can be used in place of
shiny::checkboxInput()
.
lcarsCheckbox(
inputId,
label,
value = FALSE,
color = "atomic-tangerine",
background_color = "#000000",
label_color = "#FFFFFF",
label_right = FALSE,
width = NULL
)
character, the input slot that will be used to access the value.
character, display label for the control, or NULL
for no label.
logical, initial value.
Check color. Can be any color given in hex format. Named colors must be LCARS colors. See lcarsdata for options.
background color, as above.
label text color, as above.
logical, set to TRUE
to right align the label.
a valid CSS unit.
A checkbox control that can be added to a UI definition
## Only run examples in interactive R sessions
if(interactive()){
ui <- lcarsPage(
lcarsCheckbox("somevalue", "Some value", FALSE),
verbatimTextOutput("value")
)
server <- function(input, output) {
output$value <- renderText({ input$somevalue })
}
shinyApp(ui, server)
}