Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bs_vars_badge

Bootstrap badge variables


Description

Those variables can be used to customize badge in Bootstrap and Bootswatch themes.

Usage

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
)

Arguments

color

Text color.

bg

Background color.

link_hover_color

Linked badge text color on hover.

active_color

Badge text color in active nav link.

active_bg

Badge background color in active nav link.

font_weight

Font weight, e.g. : "bold".

line_height

Line height.

border_radius

Border radius.

Value

a list that can be used in create_theme.

Examples

bs_vars_badge(
  color = "firebrick",
  bg = "steelblue"
)


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)

}

fresh

Create Custom 'Bootstrap' Themes to Use in 'Shiny'

v0.2.0
GPL-3
Authors
Victor Perrier [aut, cre, cph], Fanny Meyer [aut], Thomas Park [ctb, cph] (Bootswatch themes), Mark Otto [ctb] (Bootstrap library), Jacob Thornton [ctb] (Bootstrap library), Bootstrap contributors [ctb] (Bootstrap library), Twitter, Inc [cph] (Bootstrap library), onkbear [ctb, cph] (admin-lte-2-sass), Colorlib [ctb, cph] (AdminLTE)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.