Skip to content

TimeSelect Delivery time selection ​

A checkout-grade time picker: a date column on the start (N days from today, set by days) next to a time-slot grid. mode="express" (as soon as possible) picks the first available slot automatically; mode="schedule" lets users pick a date and a slot. The value contract is a JSON object { date, slot }.

Express (default) ​

In express mode the component picks the first available slot, so the host can read value directly. Slot data is injected through slots.

Default express mode

Nothing selected yet

Scheduled delivery ​

mode="schedule" shows the date column and the slot grid. Clicking a date switches that day's slots; dates without any available slot are dimmed and skipped by keyboard navigation.

mode="schedule"

Pick a date and a slot

Closed and fully booked ​

The two unavailable meanings are visually distinct: closed (disabled) is dimmed and labelled "Closed"; fully booked (full) also gets a strikethrough label and a "Fully booked" badge. Both are native disabled buttons (also carrying aria-disabled), clicking them does not change the value, and keyboard navigation skips them.

Closed / fully booked

Disabled ​

disabled disables the whole control: mode buttons, dates and slots.

disabled

Keyboard and accessibility ​

  • The date column is a role="tablist" (vertical) of role="tab" buttons; the slot grid and the mode group are role="radiogroup" of role="radio" buttons. Selection state is exposed through aria-selected / aria-checked.
  • All three regions use roving tabindex: exactly one Tab stop each. The mode group switches modes with left / right arrows (Home / End jump to the first / last mode); arrow keys move between available items (skipping closed, fully booked and unavailable dates), Home / End jump to the first / last available item, and left / right directions mirror under RTL.
  • Date labels are formatted with Intl.DateTimeFormat (locale aware), with relative labels for today / tomorrow; the grid's accessible name combines the group title with the active date.

Value contract ​

value is { date: 'YYYY-MM-DD', slot: 'key' }. Assigning an object property or writing JSON to the attribute both work and do not emit events; oas-change fires only when the user switches mode, date or slot. Express mode ignores a host-written value and always selects the first available slot.

Events and values

API ​

oas-time-select ​

Attributes ​

AttributeDescriptionTypeDefault
daysNumber of days in the date column (N days from today; default 3, valid range 1–14; invalid values fall back and warn once)number | string—
disabledDisables the whole control: mode buttons, dates and slotsboolean—
modeDelivery mode: express as soon as possible (default, auto-picks the first available slot) / schedule; invalid values fall back to express with a warningstringexpress
slotsShared slot JSON array [{ key, label, disabled?, full? }]; string items collapse to key=labelstring—
slots-overridePer-date slot overrides as a JSON object { "YYYY-MM-DD": [...] }; a matched date uses the override, and an empty array marks that date undeliverablestring—
start-dateFirst date as YYYY-MM-DD (defaults to today; lets hosts pin the dispatch day and tests pin a clock)string—
valueValue JSON object { date, slot } where date is YYYY-MM-DD and slot is the slot keyTimeSelectValue | string—

Property (JS property; see each row for attribute reflection) ​

PropertyDescriptionTypeDefault
daysNumber of days in the date column: get+set dual channel; assignment applies immediately without emitting eventsnumber | string—
valueCurrent value: get+set dual channel (object or JSON string); assignment applies immediately without emitting eventsTimeSelectValue | string—

Events ​

EventDescription
oas-changeDispatched when the user switches mode, date or slot, with detail: { value, mode, date, slot }

Released under the MIT OR Apache-2.0 License.