Home > widget-integration > CartSelectors > createCartCountBubble

CartSelectors.createCartCountBubble() method

Safely create cart count bubble element with proper text content (XSS-safe)

Signature:

protected createCartCountBubble(cartItemCount: number, className?: string): HTMLDivElement;

Parameters

Parameter

Type

Description

cartItemCount

number

Cart item count to display

className

string

(Optional) CSS class for the bubble element

Returns:

HTMLDivElement

HTMLDivElement with safe text content