Skip to contents

Create a text label tag using Designsystemet styles.

Usage

ds_tag(..., color = NULL, variant = NULL, size = NULL, class = NULL)

Arguments

...

Tag content (text or child elements).

color

Color context: one of "info", "success", "warning", "danger", "accent", "neutral", "brand1", "brand2". Maps to the DS data-color attribute.

variant

Structural variant: "outline" adds a subtle border.

size

Size variant ("sm", "md", "lg").

class

Additional CSS classes.

Value

A Shiny tag object

Details

Tags are the right component for standalone text status labels such as "New", "Beta" or "Active". For numeric count indicators, use ds_badge.

Examples

ds_tag("New")
#> <span class="ds-tag">New</span>
ds_tag("Active",  color = "success")
#> <span class="ds-tag" data-color="success">Active</span>
ds_tag("Warning", color = "warning", variant = "outline")
#> <span class="ds-tag" data-color="warning" data-variant="outline">Warning</span>