as_badge: Generates badge icons

View source: R/menu-item.R

as_badgeR Documentation

Generates badge icons

Description

Usually used along with card, card2, and card_tabset. See tools parameters in these functions accordingly.

Usage

as_badge(badge = NULL)

Arguments

badge

characters, "shiny.tag" object or NULL

Details

When badge is NULL or empty, then as_badge returns empty strings. When badge is a "shiny.tag" object, then 'HTML' class 'right' and 'badge' will be appended. When badge is a string, it should follow the syntax of "message|class". The text before "|" will be the badge message, and the text after the "|" becomes the class string.

Value

'HTML' tags

Examples


# Basic usage
as_badge("New")

# Add class `bg-red` and `no-padding`
as_badge("New|bg-red no-padding")



shidashi documentation built on June 21, 2022, 5:05 p.m.