Learn R Programming

yonder (version 0.0.5)

badge: Badges

Description

Small highlighted content which scales to its parent's size.

Usage

badge(..., pill = FALSE)

Arguments

...

Additional named argument passed as HTML attributes to the parent element.

pill

One of TRUE or FALSE specifying if the badge has more rounded corners, defaults to FALSE.

See Also

Other content: alert, blockquote, card, collapsiblePane, d1, dropdown, img, jumbotron, modal, navContent, popover, pre, progressOutlet, toast, tooltip

Examples

Run this code
# NOT RUN {
## Buttons with badges

buttonInput(
  id = "button1",
  label = "Process",
  badge(7) %>%
    background("cyan")
)

## Possible colors

colors <- c(
  "red", "purple", "indigo", "blue", "cyan", "teal", "green",
  "yellow", "amber", "orange", "grey", "white"
)

div(
  lapply(colors, function(color) {
    badge(color) %>%
      background(color) %>%
      margin(2)
  })
) %>%
  display("flex") %>%
  flex(wrap = TRUE)

# }

Run the code above in your browser using DataLab