twCheckboxInput {shiny.tailwind} | R Documentation |
Wrapper around shiny::checkboxInput()
but allowing for more classes
Description
Wrapper around shiny::checkboxInput()
but allowing for more classes
Usage
twCheckboxInput(
inputId,
label,
value = FALSE,
width = NULL,
disabled = FALSE,
container_class = NULL,
label_class = NULL,
input_class = NULL,
center = FALSE
)
Arguments
inputId |
The |
label |
Display label for the control, or |
value |
Initial value ( |
width |
The width of the input, e.g. |
disabled |
if the user should not be able to interact with the field |
container_class |
additional classes to be applied to the container |
label_class |
additional classes to be applied to the label |
input_class |
additional classes to be applied to the input element |
center |
if a margin of 0px !important should be applied, effectively removing bootstrap styling (if applied) to center the checkbox easier |
Value
a list with a shiny.tag
class
See Also
Examples
shiny::checkboxInput("id", "label", value = FALSE)
twCheckboxInput("id", "label",
value = TRUE, width = "200px", disabled = TRUE,
container_class = "CONTAINER", label_class = "LABEL", input_class = "INPUT"
)
# basic full shiny example
library(shiny)
ui <- fluidPage(
use_tailwind(),
twCheckboxInput(
"chk", "Check me!",
value = 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 = "text-pink-500 focus:ring-pink-500",
center = TRUE
),
verbatimTextOutput("out")
)
server <- function(input, output) {
output$out <- renderText({
input$chk
})
}
if (interactive()) shiny::shinyApp(ui, server)
[Package shiny.tailwind version 0.2.2 Index]