Description Usage Arguments Value Examples
View source: R/vars-bootstrap.R
Those variables can be used to customize
dropdowns (e.g. shinyWidgets::dropdownButton
in Bootstrap and Bootswatch themes.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
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
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | bs_vars_dropdown(
bg = "#FAFAFA",
border = "firebrick"
)
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)
}
|
$`dropdown-bg`
[1] "#FAFAFA"
$`dropdown-border`
[1] "firebrick"
attr(,"class")
[1] "fresh_sass_vars" "bootstrap_vars" "list"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.