Tag is a short label with an optional leading icon. Since 0.13 it renders
.talos-flag, the tag and status chip with a top-right chamfer, from
talos.css. variant="badge" keeps the pre-0.13 look, .talos-badge from
talos-feedback.css. size="sm" adds the --sm modifier of either base
class, so the tag hugs one line of text.
Flag (default)
PREVIEW
deploy deploy
Badge variant
PREVIEW
deploy deploy
---
import Tag from "@j_shelfwood/talos-ui/astro/Tag.astro";
---
<Tag>deploy</Tag> <!-- .talos-flag -->
<Tag size="sm">deploy</Tag> <!-- .talos-flag.talos-flag--sm -->
<Tag variant="badge">deploy</Tag> <!-- .talos-badge -->
<Tag size="sm"><Icon slot="icon" name="lucide:tag" />deploy</Tag>
The icon slot renders before the label; the default slot is the label.
Props
| Prop | Type | Default | Meaning |
|---|---|---|---|
size | "sm" | "md" | "md" | "sm" adds --sm and hugs one text line |
variant | "flag" | "badge" | "flag" | "flag" renders .talos-flag; "badge" renders the pre-0.13 .talos-badge |
class | string | none | extra classes, appended after the base class |
...rest | HTMLAttributes<"span"> | none | forwarded to the <span> |
The flag needs @j_shelfwood/talos-ui/talos.css; the badge variant needs
@j_shelfwood/talos-ui/talos-feedback.css. Both are in all.css.