C&C Docs
Log in

cnc-calendar-scroller

One month as a horizontal strip of days rather than a grid — the shape a booking bar or a filter row wants. It knows which days are working days and picks one date or a range. The chevrons beside the title page the month; the arrows either side of the track scroll the strip a page at a time within it.

Quick start

Bind $value. Weekends are non-working by default, so they are greyed and refuse clicks.

October 2026
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
(empty)
<div x-data="{ day: '' }">
  <cnc-calendar-scroller name="scroll-date" $value="day">
  </cnc-calendar-scroller>
</div>

In a form

name renders a hidden input holding the value, so a surrounding form posts it — one field, comma-joined, even for a range.

<form method="post" action="/slots">
  <cnc-calendar-scroller name="slot_dates" range></cnc-calendar-scroller>
  <button type="submit">Reserve</button>
</form>

// posts slot_dates=2026-09-07,2026-09-11

Things to know

  • A drag is a range gesture only. With range off there is no span to express, so dragging does nothing and the strip keeps click-to-pick.
  • The header chevrons and the track arrows are different controls. The chevrons beside the title page the month; the arrows either side of the track scroll the strip inside the month it is showing. Both are arrows, so it is worth saying out loud.
  • The track arrows scroll by one visible width. In a wide container the whole month may already fit, in which case they do nothing visible. That is not a fault — there is simply nothing to scroll.
  • The value is a string, the event detail is not. value is "from,to"; $event.detail.value is ["from","to"], or a plain string in single mode.
  • A pre-set value is not checked against availability. A value naming a holiday or a non-working weekday still renders as selected. The rules gate clicks, not the property.

Usage guidance

Use the strip where a grid would be too tall and the choice is nearby in time — a "pick a day this month" bar above a list of slots, a date filter in a toolbar. Its horizontal shape is the reason to choose it; its single month is the reason not to. For anything further out, or any range crossing a month, use cnc-calendar-compact, and where whole days are unavailable and the user needs to see the pattern at a glance, the month grid of cnc-calendar-availability says it better.

← Back to Widgets