Skip to main content

<tl-cart-badge>

HTML tag<tl-cart-badge>
Reactimport { TlCartBadge } from '@ticketlayer/elements-react'
CategoryCart
Runs inweb (browser DOM)

Properties

PropertyAttributeDescriptionTypeDefault
badgeOnlybadge-onlyBadge only mode - only shows the count bubble, no icon or buttonbooleanfalse
iconiconCustom icon (emoji or text). If not provided, uses cart SVGstring | undefinedundefined
showEmptyshow-emptyShow the badge even when count is 0booleanfalse
sizesizeSize variant"lg" | "md" | "sm"'md'

Events

EventDescriptionType
tlClickEmitted when the badge is clickedCustomEvent<{ itemCount: number; }>

Events are CustomEvents; the payload is on event.detail. In HTML, listen with element.addEventListener('tlXxx', handler); in React the wrapper exposes each one as an onTlXxx prop.