Indicator | Badge
Badge#
Description#
- Compact badge for displaying counters, statuses or origins. The text uses
tx-mainover a translucent fill, and it can be used as a counter overlay on an icon or as a text label.
Props#
tone('neutral' | 'accent' | 'info' | 'success' | 'warning' | 'error') — Badge color tone. Default:'neutral'.variant('soft' | 'outline' | 'solid' | 'overlay') — Visual style. Default:'soft'.size('sm' | 'md') — Badge size. Default:'sm'.dot(boolean) — Shows a dot in the tone color before the text. Default:false.color(string) — Data color that tints the dot and border.label(string | number) — Badge text if the slot is not used.counter(boolean) — Counter mode: text never wraps, at least as wide as tall. Default:false.max(number) — With a numericlabelabove this, it renders «max+». Default:undefined.title(string) — Full text for the system tooltip. Default:undefined.
Usage#
| |
Notes#
- Counter mode prevents text wrapping and works as an overlay on an icon.
coloris applied as a CSS variable (--badge-color) and tints the dot and border, never the text.- With
variant="solid"andtone="accent"or"info", the text usestx-on-primaryover the full primary fill.