| |
|---|
| HTML tag | <tl-buy-tickets-button> |
| React | import { TlBuyTicketsButton } from '@ticketlayer/elements-react' |
| Category | Purchase |
| Runs in | web (browser DOM) |
Properties
| Property | Attribute | Description | Type | Default |
|---|
currency | currency | Currency code for price formatting | string | 'GBP' |
disabled | disabled | Disabled state | boolean | false |
eventId (required) | event-id | Event ID to purchase tickets for | string | undefined |
fullWidth | full-width | Full width button | boolean | false |
label | label | Button label override (default depends on state) | string | undefined | undefined |
occurrenceId | occurrence-id | Optional pre-selected occurrence ID | string | undefined | undefined |
price | price | Price to display (in minor units e.g. pence) | number | undefined | undefined |
pricePrefix | price-prefix | Show price prefix text | string | 'From' |
size | size | Button size | "lg" | "md" | "sm" | 'md' |
state | state | Button state - determines colour, label, and icon | "available" | "comingSoon" | "soldOut" | "waitlist" | 'available' |
variant | variant | Button variant | "outline" | "primary" | "secondary" | 'primary' |
Events
| Event | Description | Type |
|---|
tlClick | Emitted when button is clicked (before modal opens) | CustomEvent<{ eventId: string; occurrenceId?: string | undefined; }> |
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.