Skip to content
Docs
Reference

<tl-occurrence-selector>

A smart occurrence selector component that fetches and displays event occurrences from the Ticketlayer API.

HTML tag<tl-occurrence-selector>
Reactimport { TlOccurrenceSelector } from '@ticketlayer/elements-react'
CategoryDiscovery
Runs inweb (browser DOM)

A smart occurrence selector component that fetches and displays event occurrences from the Ticketlayer API.

A smart occurrence selector component that fetches and displays event occurrences from the Ticketlayer API.

Features#

  • Automatic data fetching - Fetches occurrences via the Ticketlayer SDK
  • Adaptive display modes - Automatically chooses list, slots, or calendar view based on occurrence count
  • Loading & error states - Built-in spinner and error handling with retry
  • Responsive - Works on mobile and desktop with auto-adjusting layouts
  • Themeable - Fully customizable via CSS custom properties

Usage#

import { TlOccurrenceSelector } from '@ticketlayer/elements-react';

<TlOccurrenceSelector
  eventId="evt_001"
  onTlSelect={(e) => console.log('Selected:', e.detail.occurrence)}
/>

Properties#

PropertyAttributeDescriptionTypeDefault
displayModedisplay-modeForce a specific display mode (auto-detected if not set)"calendar" | "calendar-slots" | "dates" | "list" | "slots" | undefinedundefined
eventId (required)event-idEvent ID to fetch occurrences forstringundefined
occurrenceIdoccurrence-idThe occurrence already picked: the element opens on its day and marks itstring | undefinedundefined
orientationorientationLayout orientation (auto = horizontal on desktop, vertical on mobile)"auto" | "horizontal" | "vertical"'auto'
theme--Theme configurationTlOccurrenceSelectorTheme | undefinedundefined
unstyledunstyledRender into the light DOM with no stylesheet, for a page that styles the element itself: every node carries a tl-occurrence-selector__* class. Without it the element is styled, and each node is a ::part() of the same name.booleanfalse

Events#

EventDescriptionType
tlSelectEmitted when an occurrence is selectedCustomEvent<{ occurrence: TlOccurrence; }>

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.

Used by: <tl-buy-modal>