Sablon:Badge/doc
More actions
Renders an inline badge — a small pill-shaped label suited for status tags, version markers, faction labels, or any short metadata that should read as a distinct chip rather than plain text. Wraps Module:BadgeLua; see the module page for rendering details.
Usage
The first positional argument is the badge text. variant themes the badge via Citizen design tokens; color/bg override those tokens with literal CSS values; icon adds a 16px image before the text.
| Wikitext | Result |
|---|---|
{{Badge|Aurora}}
|
Aurora |
{{Badge|Genesis|variant=warning}}
|
Genesis |
{{Badge|Caterpillar|variant=error}}
|
Caterpillar |
{{Badge|Carrack|variant=success}}
|
Carrack |
{{Badge|30K|icon=CdxIconError.svg|bg=#2a6df4|color=#fff}}
|
30K |
Parameters
Renders an inline badge — a small pill-shaped label suited for status tags, version markers, faction labels, or any short metadata that should read as a distinct chip rather than plain text. Wraps Module:BadgeLua; see the module page for rendering details.
| Paraméter | Leírás | Típus | Állapot | |
|---|---|---|---|---|
| Text | 1 | Badge label. Wikitext is allowed.
| Karakterlánc | kötelező |
| Variant | variant | Semantic preset that themes the badge via Citizen design tokens. One of `error`, `success`, `warning`. Unknown values are ignored.
| Karakterlánc | nem kötelező |
| Icon | icon | File name (without the `File:` prefix) of an icon rendered before the text at 16px.
| Fájl | nem kötelező |
| Text color | color | CSS color applied to the badge text. Overrides `variant`.
| Karakterlánc | nem kötelező |
| Background color | bg | CSS background color applied to the badge. Overrides `variant`. Alias: `backgroundColor`.
| Karakterlánc | nem kötelező |
| CSS class | class | Extra class appended to the badge root.
| Karakterlánc | nem kötelező |
Behavior
variantand the rawcolor/bgprops are independent axes. Setting both is allowed — the inline color overrides the variant's text/background color but the variant's border color is kept unless the caller adds their own.- Unknown
variantvalues are silently ignored (the badge falls back to the default surface color), so a typo never produces a broken-looking class liket-badge--warnng. - The icon image is rendered with
class=metadata|link=so it's excluded from MultimediaViewer and is not clickable — the badge reads as inert decoration.
See also
- Module:BadgeLua — implementation.