Those variables can be used to customize
navigation bar component (e.g. shiny::navbarPage
) in Bootstrap and Bootswatch themes.
bs_vars_navbar(
height = NULL,
margin_bottom = NULL,
border_radius = NULL,
padding_horizontal = NULL,
padding_vertical = NULL,
collapse_max_height = NULL,
default_color = NULL,
default_bg = NULL,
default_border = NULL,
default_link_color = NULL,
default_link_active_color = NULL,
default_link_active_bg = NULL,
default_link_hover_color = NULL,
default_link_hover_bg = NULL,
inverse_color = NULL,
inverse_bg = NULL,
inverse_border = NULL,
inverse_link_color = NULL,
inverse_link_active_color = NULL,
inverse_link_active_bg = NULL,
inverse_link_hover_color = NULL,
inverse_link_hover_bg = NULL
)
Height of the navbar, e.g. "50px"
(the default in Bootstrap).
Bottom margin of navbar.
Radius border (rounded corner).
Horizontal padding.
= Vertical padding.
Max height when collapsed.
Color of text in the navbar.
Background color of the navbar.
Border color of the navbar.
Link color.
Color for active link (selected tab).
Background color for active link (selected tab).
Color of links when hovered.
Background color of links when hovered.
Color of text for inverted navbar.
Background color for inverted navbar.
Border color for inverted navbar.
Link color for inverted navbar.
Color for active link (selected tab) for inverted navbar.
Background color for active link (selected tab) for inverted navbar.
Color of links when hovered for inverted navbar.
Background color of links when hovered for inverted navbar.
a list
that can be used in create_theme
.
See default parameters for Bootstrap: https://getbootstrap.com/docs/3.4/customize/.
# Change background color of the navbar
bs_vars_navbar(
default_bg = "#75b8d1",
default_color = "#FFFFFF",
default_link_color = "#FFFFFF",
default_link_active_color = "#FFFFFF"
)
#> $`navbar-default-color`
#> [1] "#FFFFFF"
#>
#> $`navbar-default-bg`
#> [1] "#75b8d1"
#>
#> $`navbar-default-link-color`
#> [1] "#FFFFFF"
#>
#> $`navbar-default-link-active-color`
#> [1] "#FFFFFF"
#>
#> attr(,"class")
#> [1] "fresh_sass_vars" "bootstrap_vars" "list"
if (interactive()) {
library(shiny)
ui <- navbarPage(
title = "Custom navbar",
header = use_theme(
create_theme(
theme = "default",
bs_vars_navbar(
default_bg = "#75b8d1",
default_color = "#FFFFFF",
default_link_color = "#FFFFFF",
default_link_active_color = "#75b8d1",
default_link_active_bg = "#FFFFFF",
default_link_hover_color = "firebrick"
),
output_file = NULL
)
),
tabPanel("Tab 1"),
tabPanel("Tab 2")
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
}