Skip to content
Docs
Reference

<tl-buy-tickets-button>

A buy-tickets button in one of four sale states, which opens the purchase modal.

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

A buy-tickets button in one of four sale states, which opens the purchase modal.

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'
unstyledunstyledRender into the light DOM with no stylesheet, for a page that styles the element itself: every node carries a tl-buy-tickets-button__* class. Without it the element is styled, and each node is a ::part() of the same name.booleanfalse
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.