StealThis .dev

Ticketing — Event Card

A reusable event ticketing card pattern rendered as a responsive grid of six distinctive variants. Each card pairs a photographic gradient hero with a floating date badge, category tag, venue line, and a prominent price-from figure. Interactive states cover a save heart toggle with a satisfying pop, hover lift, low-stock and sold-out badges, plus disabled checkout for unavailable shows. Keyboard friendly with a lightweight toast helper and full WCAG-minded contrast.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Event Card

A drop-in event card built for a ticketing listing. Every card leads with a photographic gradient hero overlaid with a floating calendar date badge, then steps down through a colour-coded category tag, the event title, and the venue line. A dashed perforation separates the body from the footer, where a bold price-from figure sits opposite a pill-shaped get-tickets call to action — echoing the torn-stub motif of a real ticket.

The six variants in the grid demonstrate the full state matrix: standard availability, two low-stock cards with amber “Only N left” badges, and a sold-out show that greys its hero, locks its checkout button, and softens its hover lift. A circular save heart in the top corner toggles between outline and filled accent pink, firing a quick pop animation and a confirmation toast each time.

Interactions are vanilla JavaScript with no dependencies. The heart and CTA stop event propagation so inner controls never clash, while focused cards respond to Enter and Space for keyboard users. The layout reflows from a multi-column auto-fill grid down to a single column at narrow widths, staying legible to roughly 360px.

Illustrative UI only — fictional events, not a real ticketing service.