Skip to content
Docs
Reference

<tl-cart>

The buyer's cart: its lines, the money rows the surface reported and a checkout button.

HTML tag<tl-cart>
Reactimport { TlCart } from '@ticketlayer/elements-react'
CategoryCart
Runs inweb (browser DOM), native (planned React Native set)

The buyer's cart: its lines, the money rows the surface reported and a checkout button.

Properties#

PropertyAttributeDescriptionTypeDefault
checkoutLabelcheckout-labelCheckout button labelstring'Checkout'
compactcompactCompact mode - hides some detailsbooleanfalse
showCheckoutButtonshow-checkout-buttonShow checkout buttonbooleantrue
showRemoveButtonsshow-remove-buttonsShow remove item buttonsbooleantrue
unstyledunstyledRender into the light DOM with no stylesheet, for a page that styles the element itself: every node carries a tl-cart__* class. Without it the element is styled, and each node is a ::part() of the same name.booleanfalse

Events#

EventDescriptionType
tlCartUpdatedEmitted when cart is updatedCustomEvent<{ cart: TlCartData; }>
tlCheckoutEmitted when checkout is clickedCustomEvent<{ cart: TlCartData; }>
tlErrorEmitted on errorCustomEvent<{ message: string; }>
tlItemRemovedEmitted when item is removedCustomEvent<{ itemId: string; }>
tlSeatRemovedEmitted when a held seat is given backCustomEvent<{ occurrenceId: string; seat: 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.

Renders: <tl-price-picker>

Used by: <tl-buy-modal>, <tl-cart-drawer>