| ds_badge | R Documentation |
Create a count-indicator badge using Designsystemet styles.
ds_badge(
count = NULL,
color = NULL,
variant = NULL,
size = NULL,
class = NULL,
...
)
count |
Numeric or character value shown inside the badge circle.
Pass |
color |
Color context: one of |
variant |
Structural variant: |
size |
Size variant ( |
class |
Additional CSS classes. |
... |
Additional attributes passed to the |
The badge is a small circle that sits on top of another element (e.g. a
button) to show a numeric count. Wrap the target element with a
ds_badge_position() container and place ds_badge() inside it.
The circle text comes from count; ... is the accessible label
for the element being badged (rendered as invisible span text).
A Shiny tag object
# Standalone dot with no count
ds_badge(color = "success")
# Count badge on a button (typical use — see ds_badge_position())
## Not run:
ds_badge_position(
ds_button("Inbox"),
ds_badge(count = 4, color = "danger")
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.