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 input slot that will be used to access the value.

label

Display label for the control, or NULL for no label.

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 choiceNames and choiceValues must not be provided, and vice-versa. The values should be strings; other types (such as logicals and numbers) will be coerced to strings.

selected

The values that should be initially selected, if any.

inline

If TRUE, render the choices inline (i.e. horizontally)

width

The width of the input, e.g. '400px', or '100%'; see validateCssUnit().

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

shiny::checkboxGroupInput()

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)

[Package shiny.tailwind version 0.2.2 Index]