Skip to main content

<tl-buy-tickets-button>

HTML tag<tl-buy-tickets-button>
Reactimport { TlBuyTicketsButton } from '@ticketlayer/elements-react'
CategoryPurchase
Runs inweb (browser DOM)

Properties

PropertyAttributeDescriptionTypeDefault
currencycurrencyCurrency code for price formattingstring'GBP'
disableddisabledDisabled statebooleanfalse
eventId (required)event-idEvent ID to purchase tickets forstringundefined
fullWidthfull-widthFull width buttonbooleanfalse
labellabelButton label override (default depends on state)string | undefinedundefined
occurrenceIdoccurrence-idOptional pre-selected occurrence IDstring | undefinedundefined
pricepricePrice to display (in minor units e.g. pence)number | undefinedundefined
pricePrefixprice-prefixShow price prefix textstring'From'
sizesizeButton size"lg" | "md" | "sm"'md'
statestateButton state - determines colour, label, and icon"available" | "comingSoon" | "soldOut" | "waitlist"'available'
variantvariantButton variant"outline" | "primary" | "secondary"'primary'

Events

EventDescriptionType
tlClickEmitted 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.