View source: R/reactCheckbox.R
| reactCheckboxesInput | R Documentation |
Create a checkbox group input for usage in Shiny.
reactCheckboxesInput( inputId, checkboxes, headLabel = "Check all", headClass = "", styles = NULL, theme = "material" )
inputId |
the id that will be used to get the values in Shiny |
checkboxes |
a list of checkboxes defined with the
|
headLabel |
the label for the head checkbox |
headClass |
a CSS class for the head checkbox |
styles |
a named list of styles created with the
|
theme |
the theme, |
A shiny.tag.list object to be included in a Shiny UI.
library(shiny)
library(htmltools)
library(reactCheckbox)
ui <- fluidPage(
reactCheckboxesInput(
"iris",
list(
checkbox("Sepal length", FALSE),
checkbox("Sepal width", FALSE),
checkbox("Petal length", FALSE),
checkbox("Petal width", FALSE)
),
headLabel = tags$span(
"Make a choice", style = "font-size: 1.8rem; font-style: italic;"
),
headClass = "custom",
theme = "material",
styles = list(
"custom" = checkboxStyle(
checked = css(
background.color = "darkred"
),
checked_hover = css(
background.color = "maroon"
),
unchecked = css(
background.color = "darkorange"
),
unchecked_hover = css(
background.color = "orange"
),
indeterminate = css(
background.color = "gold"
),
indeterminate_hover = css(
background.color = "yellow"
)
)
)
)
)
server <- function(input, output, session) {
observe({
print(input[["iris"]])
})
}
if(interactive()) {
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.