twCheckboxGroupInput {shiny.tailwind} | R Documentation |
Wrapper around shiny::checkboxGroupInput()
but allowing for more classes
Description
Wrapper around shiny::checkboxGroupInput()
but allowing for more classes
Usage
twCheckboxGroupInput(
inputId,
label,
choices = NULL,
selected = NULL,
inline = FALSE,
width = NULL,
container_class = NULL,
main_label_class = NULL,
input_class = NULL,
label_class = NULL,
inner_container_class = NULL,
disabled = FALSE
)
Arguments
inputId |
The |
label |
Display label for the control, or |
choices |
List of values to show checkboxes for. If elements of the list
are named then that name rather than the value is displayed to the user. If
this argument is provided, then |
selected |
The values that should be initially selected, if any. |
inline |
If |
width |
The width of the input, e.g. |
container_class |
additional classes to be applied to the container |
main_label_class |
additional classes to be applied to the main label |
input_class |
additional classes to be applied to the input element |
label_class |
additional classes to be applied to the label |
inner_container_class |
additional classes to be applied to the container for each option |
disabled |
if the user should not be able to interact with the field |
Value
a list with a shiny.tag
class
See Also
Examples
shiny::checkboxGroupInput("id", "label", choices = c("A", "B"))
twCheckboxGroupInput("id", "label",
choices = c("A", "B"),
width = "200px", disabled = c(TRUE, FALSE),
container_class = "OUTER.CONTAINER",
inner_container_class = c("INNER CONTAINER 1", "INNER CONTAINER 2"),
label_class = c("LABEL 1", "LABEL 2"),
input_class = "INPUT-ALL"
)
# basic full shiny example
library(shiny)
ui <- fluidPage(
use_tailwind(),
twCheckboxGroupInput(
"chks", "Check all that apply:",
choices = c("This" = "a", "That" = "b", "None (disabled)" = "c"),
disabled = c(FALSE, FALSE, TRUE),
container_class = "w-48 m-4 p-2 border border-gray-200 rounded-md drop-shadow-md",
label_class = "font-serif text-gray-600",
input_class = "rounded rounded-full text-pink-500 border-pink-200 focus:ring-pink-500",
),
verbatimTextOutput("out")
)
server <- function(input, output) {
output$out <- renderText({
input$chks
})
}
if (interactive()) shiny::shinyApp(ui, server)