projects/common/display/badge/badge.directive.ts
import { CngxBadge } from '@cngx/common/display'
Generic counter / dot indicator that attaches a small floating element to any host. Purely presentational (aria-hidden="true") - semantic meaning must live on the host (aria-label).
aria-hidden="true"
aria-label
Supports:
max
true
https://cngxjs.github.io/cngx/examples/#/common/display/badge/colors-and-dot-mode https://cngxjs.github.io/cngx/examples/#/common/display/badge/counts-with-overflow https://cngxjs.github.io/cngx/examples/#/common/display/badge/inline-and-hidden
[cngxBadge]
cngxBadge
number | string | boolean
Raw value. Numbers show as text (respecting max); booleans flip dot mode; strings render verbatim.
CngxBadgeColor
Color variant.
'primary'
boolean
Whether the indicator is hidden regardless of value.
false
number
Cap for numeric values - anything over renders as "{max}+".
"{max}+"
99
CngxBadgePosition
Anchor position relative to the host.
'above-end'
[class.cngx-badge-host]
no-iframes