View source: R/twCheckboxInput.R
twCheckboxInput | R Documentation |
shiny::checkboxInput()
but allowing for more classesWrapper around shiny::checkboxInput()
but allowing for more classes
twCheckboxInput(
inputId,
label,
value = FALSE,
width = NULL,
disabled = FALSE,
container_class = NULL,
label_class = NULL,
input_class = NULL,
center = FALSE
)
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 |
a list with a shiny.tag
class
shiny::checkboxInput()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.