Those variables can be used to customize
dropdowns (e.g. shinyWidgets::dropdownButton
in Bootstrap and Bootswatch themes.
bs_vars_dropdown( bg = NULL, border = NULL, fallback_border = NULL, divider_bg = NULL, link_color = NULL, link_hover_color = NULL, link_hover_bg = NULL, link_active_color = NULL, link_active_bg = NULL, link_disabled_color = NULL, header_color = NULL )
bg | Background color for the dropdown menu. |
---|---|
border | Dropdown menu border-color. |
fallback_border | Dropdown menu border-color (for IE8). |
divider_bg | Divider color for between dropdown items. |
link_color | Dropdown link text color. |
link_hover_color | Hover color for dropdown links. |
link_hover_bg | Hover background for dropdown links. |
link_active_color | Active dropdown menu item text color. |
link_active_bg | Active dropdown menu item background color. |
link_disabled_color | Disabled dropdown menu item background color. |
header_color | Text color for headers within dropdown menus. |
a list
that can be used in create_theme
.
#> $`dropdown-bg` #> [1] "#FAFAFA" #> #> $`dropdown-border` #> [1] "firebrick" #> #> attr(,"class") #> [1] "fresh_sass_vars" "bootstrap_vars" "list"if (interactive()) { library(shiny) library(shinyWidgets) ui <- fluidPage( use_theme( create_theme( theme = "default", bs_vars_dropdown( bg = "#FAFAFA", border = "firebrick" ), output_file = NULL ) ), tags$h1("Custom dropdowns"), dropdownButton( inputId = "mydropdown", label = "Controls", icon = icon("sliders"), status = "primary", circle = FALSE, sliderInput( inputId = "n", label = "Number of observations", min = 10, max = 100, value = 30 ), prettyToggle( inputId = "na", label_on = "NAs keeped", label_off = "NAs removed", icon_on = icon("check"), icon_off = icon("remove") ) ) ) server <- function(input, output, session) { } shinyApp(ui, server) }