Angular Badges Library | ng-hub-ui-badges

Semantic Angular badges for statuses, counters and removable filter tags, with CSS variables and public SCSS mixins for custom colour families.

API reference

Here's the full contract for badges: everything you can bind, listen to, project and theme, gathered in one place. Wire up what you need and style what you want — it's standalone and signal-friendly.

Inputs

Dial badges in with 20 inputs. Bind them like any Angular @Input.

NameTypeDefaultDescription
variantHubBadgeVariant'solid'Visual treatment of the badge shell.
colorHubBadgeColor'primary'Semantic colour family. Built-ins map to the design-system token families and custom names are supported.
sizeHubBadgeSize'md'Badge size scale.
shapeHubBadgeShape'pill'Corner treatment of the badge shell.
dotbooleanfalseRenders a leading status dot before the label.
removablebooleanfalseEnables the dismiss affordance, turning the badge into a removable filter/tag.
removeLabelstring'Remove badge'Accessible label applied to the dismiss button.
tooltipstring''Explicit tooltip text. When omitted, the badge shows its own content as a tooltip only while it is truncated.
interactivebooleanfalseTurns the badge into an interactive toggle: exposes role="button", a keyboard tab stop, and emits the selected output on activation.
activebooleanfalseReflects the pressed/selected state of an interactive badge, toggling .hub-badge--active and the aria-pressed attribute.
dotOverlaybooleanfalseRenders the status dot as a corner overlay pinned to the badge shell instead of the inline leading dot.
dotPlacementHubBadgeOverlayPlacement'top-end'Corner the overlay dot is pinned to when dotOverlay is enabled (e.g. top-end, top-start, bottom-end, bottom-start).
hub-chip · selectedmodel<boolean>falsehub-chip: two-way selected (pressed) state of the chip.
hub-chip · valueunknownundefinedhub-chip: opaque value identifying the chip inside its enclosing hub-chip-set.
hub-chip · colorHubBadgeColor'primary'hub-chip: semantic accent driving the chip colours, shared with hub-badge.
hub-chip · disabledbooleanfalsehub-chip: disables the chip — no toggling, no removal, removed from the tab order.
hub-chip · removablebooleanfalsehub-chip: enables the dismiss affordance, mirroring the badge dismiss pattern.
hub-chip · removeLabelstring'Remove chip'hub-chip: accessible label of the dismiss button.
hub-chip-set · selectionMode'single' | 'multiple''single'hub-chip-set: whether one (single) or many (multiple) chips can be selected at once.
hub-chip-set · valuemodel<unknown>undefinedhub-chip-set: two-way selection value — the selected chip value in single mode, or the array of selected values in multiple mode.

Outputs

React to what badges does — 6 events to hook your logic onto.

NameTypeDescription
removedEventEmitter<void>Emitted when the dismiss action of a removable badge is activated.
selectedEventEmitter<void>Emitted when an interactive badge is activated by click, Enter or Space.
hub-chip · selectedChangeEventEmitter<boolean>hub-chip: emitted whenever the two-way selected state changes.
hub-chip · removedEventEmitter<void>hub-chip: emitted when the dismiss button is activated.
hub-chip · chipClickEventEmitter<void>hub-chip: emitted on every activation (click / Enter / Space), before the toggle is applied.
hub-chip-set · valueChangeEventEmitter<unknown>hub-chip-set: emitted whenever the two-way selection value changes.

Templates

Make it yours — 1 template slots let you project custom markup.

NameDescriptionExample
[hubChipLeading]Projects a leading icon or avatar into the chip, rendered before the chip content.<hub-chip [value]="'open'" color="success"> <i hubChipLeading class="fa-solid fa-circle" aria-hidden="true"></i> Open </hub-chip>