Magoo Component UI logo Magoo Component UI
← Catalog

Booking Date Range

booking-date-range molecule experimental

A start/end date-range picker with a highlighted range and summary.

Also in: Forms

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

August 2026 Aug 12 – Aug 19 · 7 nights
MTWTFSS

Props

NameTypeReq
month string ✓
summary string
weekdays array ✓
days array ✓

How to use

The component is interactive out of the box via its behavior.js — no props are needed to enable it. The user selects a range by clicking a start day then an end day, or by pressing and dragging across the grid; the seeded start/end (from each day's `data-state`) is the initial selection. Disabled and other-month (muted) days are not selectable. The internal `.booking-date-range__summary` line is updated automatically as the selection changes. Listen for two bubbling CustomEvents on the component root (or any ancestor): - `booking-date-range:change` — fires on every selection change (start pick, drag move, end pick). Use it to live-preview pricing or availability. - `booking-date-range:rangeselected` — fires once a full range is committed (second click or drag release). Use it to confirm the booking dates. Both carry the same `event.detail`: `{ start: { index, day } | null, end: { index, day } | null, nights, complete }` where `index` is the day cell's position in the grid, `day` is its number label, `nights` is `end.index - start.index` (0 until complete), and `complete` is true when both ends are set. Example: `el.addEventListener('booking-date-range:rangeselected', e => console.log(e.detail.nights))`.

Use cases

form WCAG AA SEO 25 dir: both ai-generated