StealThis .dev

Ticketing — Date Filter Chips

A polished event-ticketing date filter that pairs one-tap window chips (today, this weekend, this week, this month) with a custom range calendar. Selecting a chip jumps the calendar to the matching month and updates an applied-range banner with a live show count, while tapping two days draws a custom start-to-end range. The matching event list re-sorts and re-filters instantly, showing perforated ticket posters, prices, and low-stock or sold-out badges.

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

Code

Date Filter Chips

A compact “when are you going?” control for an event-ticketing browse page. Four quick chips cover the windows people actually search for — today, this weekend, this week, and this month — and each one snaps the applied-range banner and the show list into place in a single tap. Tapping an active chip toggles it back off, so the same control both sets and clears a preset.

For anything the chips don’t cover, a collapsible mini calendar lets you draw a custom window: the first tap sets the start, the second sets the end, and out-of-order taps are reconciled automatically. Past days are disabled, today is dotted, and the selected span is highlighted as a continuous range with rounded caps. Choosing custom days quietly releases any active chip so the two modes never fight each other.

Every change updates a dashed applied-range banner with a human-readable label and a live count of matching shows, then re-filters and re-sorts the event list — each card carrying a perforated poster, venue, price, and a selling-fast, low-stock, or sold-out badge. The component emits a daterange:change event (and logs the selection) so a host page can react to the chosen window.

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