Time Slot Picker
Pick a free time from someone's calendar: a row of days, then that day's times grouped into morning, afternoon and evening.
c2-time-slot-picker is the booking step of Calendly and Cal.com. A c2-date-strip picks the day, with a dot on the days that have a free time, and the day’s times show below it, grouped into morning, afternoon and evening. A time that is taken stays in place, struck through.
Import
import '@c2n/components/time-slot-picker'Usage
Slots
slots lists the times, as a JSON attribute or a property: each has a start, an ISO date-time with its offset (2026-11-02T09:00:00+01:00 or …Z), an optional end, an optional label shown in place of the time, and available: false for one that is taken. The picker sorts them and files each under its day.
Time zone
time-zone names the IANA zone the times are shown in (Europe/Paris); by default it is the browser’s. A slot is filed under its day in that zone, so 23:00 UTC is the next morning in Tokyo. The line under the days names the zone.
Days
The day shown is date (YYYY-MM-DD). By default it is the day of the value, else the first day from today with a free time. Days with a free time carry a dot. Days between the first and last slot with none are disabled, and the arrow keys step over them. On a day with no free time, the picker says so and offers the next day that has one. Showing another day fires date-change.
Paging the days fires range-change with the first and last day now shown. An app that loads slots a week at a time listens for it, sets loading (which shows placeholder times), and sets slots when they arrive.
Value
The value is the picked slot’s start, exactly as given. A click, or Enter or Space on the focused time, picks it and fires input then change, whose detail holds the value and the slot. show-end shows each time with its end, and group-by="none" lists the day’s times as one group.
In a form
Under a name, the form receives the value. required asks for one. Inside a c2-form-field, the field’s label names the picker and its hint and error describe the times.
Keyboard
The times have one tab stop. The arrow keys move from time to time across the groups and step over taken ones, Home and End go to the first and last, and Enter or Space picks. The days keep the strip’s own keys.