View source: R/twCheckboxGroupInput.R
twCheckboxGroupInput | R Documentation |
shiny::checkboxGroupInput()
but allowing for more classesWrapper around shiny::checkboxGroupInput()
but allowing for more classes
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
)
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 |
a list with a shiny.tag
class
shiny::checkboxGroupInput()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.