Those variables can be used to customize badge in Bootstrap and Bootswatch themes.
bs_vars_badge(
color = NULL,
bg = NULL,
link_hover_color = NULL,
active_color = NULL,
active_bg = NULL,
font_weight = NULL,
line_height = NULL,
border_radius = NULL
)
Text color.
Background color.
Linked badge text color on hover.
Badge text color in active nav link.
Badge background color in active nav link.
Font weight, e.g. : "bold"
.
Line height.
Border radius.
a list
that can be used in create_theme
.
bs_vars_badge(
color = "firebrick",
bg = "steelblue"
)
#> $`badge-color`
#> [1] "firebrick"
#>
#> $`badge-bg`
#> [1] "steelblue"
#>
#> attr(,"class")
#> [1] "fresh_sass_vars" "bootstrap_vars" "list"
if (interactive()) {
library(shiny)
ui <- fluidPage(
use_theme(create_theme(
theme = "default",
bs_vars_badge(
color = "yellow",
bg = "firebrick",
line_height = 1.2
)
)),
tags$h1("Badges"),
tags$span(class = "badge", "Simple badge"),
tags$br(),
tags$ul(
class = "list-group",
tags$li(
class = "list-group-item",
"Badge in list group",
tags$span(class = "badge", "badge")
),
tags$li(
class = "list-group-item",
"An other item",
tags$span(class = "badge", "other")
)
)
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
}