| |
|---|
| HTML tag | <tl-cart-badge> |
| React | import { TlCartBadge } from '@ticketlayer/elements-react' |
| Category | Cart |
| Runs in | web (browser DOM) |
Properties
| Property | Attribute | Description | Type | Default |
|---|
badgeOnly | badge-only | Badge only mode - only shows the count bubble, no icon or button | boolean | false |
icon | icon | Custom icon (emoji or text). If not provided, uses cart SVG | string | undefined | undefined |
showEmpty | show-empty | Show the badge even when count is 0 | boolean | false |
size | size | Size variant | "lg" | "md" | "sm" | 'md' |
Events
| Event | Description | Type |
|---|
tlClick | Emitted when the badge is clicked | CustomEvent<{ 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.