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
)
Background color for the dropdown menu.
Dropdown menu border-color.
Dropdown menu border-color (for IE8).
Divider color for between dropdown items.
Dropdown link text color.
Hover color for dropdown links.
Hover background for dropdown links.
Active dropdown menu item text color.
Active dropdown menu item background color.
Disabled dropdown menu item background color.
Text color for headers within dropdown menus.
a list
that can be used in create_theme
.
bs_vars_dropdown(
bg = "#FAFAFA",
border = "firebrick"
)
#> $`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)
}