lcarsToggle {lcars} | R Documentation |
LCARS toggle button
Description
An LCARS styled toggle button that can be used in place of
checkboxInput
and lcarsCheckbox
.
Usage
lcarsToggle(
inputId,
label,
value = FALSE,
pill = FALSE,
inverse = FALSE,
true = "Yes",
false = "No",
true_color = "dodger-pale",
false_color = "atomic-tangerine",
background_color = "#000000",
border_color = ifelse(inverse, false_color, background_color),
outer_border = FALSE,
outer_color = "#000000",
label_color = "#FFFFFF",
label_right = FALSE,
width = NULL
)
Arguments
inputId |
character, the input slot that will be used to access the value. |
label |
character, display label for the control, or |
value |
logical, initial value. |
pill |
logical, use an LCARS pill style with rounded ends instead of the default rounded rectangle. |
inverse |
logical, invert the color presentation. |
true |
character, text label for |
false |
character, text label for |
true_color |
Color for |
false_color |
Color for |
background_color |
background color, as above. |
border_color |
border color, as above. |
outer_border |
logical, use outer border. This makes some adjustments to inner elements if used. |
outer_color |
outer border color, as above. |
label_color |
label text color, as above. |
label_right |
logical, set to |
width |
character, use only |
Value
A toggle button control that can be added to a UI definition.
Examples
## Only run examples in interactive R sessions
if(interactive()){
ui <- lcarsPage(
lcarsToggle("somevalue", "Some value", FALSE),
verbatimTextOutput("value")
)
server <- function(input, output) {
output$value <- renderText({ input$somevalue })
}
shinyApp(ui, server)
}