badge: Badges

View source: R/badge.R

badgeR Documentation

Badges

Description

Small highlighted content which scales to its parent's size. A badge may be dynamically updated with replaceContent(), in which case be sure to pass an id argument as part of ....

Usage

badge(...)

Arguments

...

Named arguments passed as HTML attributes to the parent element or tag elements passed as children to the parent element.

Details

Combining badges

Badges may be combined with other elements. They can be placed inside buttons.

buttonInput(
  .style %>%
    background("primary"),
  id = NULL,
  label = "Counter",
  badge(2) %>% background("light")
)

You can also pair badges with list groups.

listGroupItem <- function(...) {
  div(...) %>%
    width(100) %>%
    display("flex") %>%
    flex(justify = "between", align = "center")
}

listGroupInput(
  .style %>%
    width(50) %>%
    background("secondary"),
  id = NULL,
  choices = list(
    listGroupItem("Mail", badge(tags$i(class = "fas fa-envelope fa-lg"))),
    listGroupItem("Research", badge(tags$i(class = "fas fa-vial fa-lg")))
  )
)

See Also

Other components: alert(), blockquote(), card(), collapsePane(), d1(), dropdown(), img(), jumbotron(), modal(), navContent(), popover(), pre(), toast()


nteetor/dull documentation built on June 10, 2022, 11:30 a.m.