Quick time menu
A menu of quick times (Later today, Tomorrow, Next week), each showing when it falls, plus a date and time picker for anything else.
c2-quick-time-menu picks a time from a short list, as a snooze, a reminder or a follow-up date does in Gmail, Slack and Linear. Each row shows the time it falls at in the reader’s clock format, and “Pick a date and time…” opens a c2-date-time-picker in place for anything else. The value is a wall-clock YYYY-MM-DDTHH:mm, the same shape the date and time picker uses.
Import
import '@c2n/components/quick-time-menu'Usage
Follow up on this thread
Presets
Without presets the rows are Later today (in about 3 hours, on the hour), This evening (at evening, 18:00), Tomorrow, This weekend and Next week (the first working day of the next week), the last three at morning (09:00). A row that no longer applies is hidden: Later today and This evening in the evening, This weekend on a weekend.
presets replaces them. Each row is { id, label, at }, where at is either a function of the current time (set the array as a property) or an expression, which also works in a JSON attribute:
| Expression | Falls at |
|---|---|
+20m, +3h, +1h30m, +2d | That long from now |
today 16:00, tomorrow | That day, at the time given or at morning |
friday 09:00 | The first Friday whose time is still ahead, today included |
next monday 09:00 | The first Monday after today |
later today, this evening, end of day, this weekend, next week | The default rows’ rules |
Times are HH:mm, 9am or 5:30pm. min and max hide the rows that fall outside them, and bound the date and time panel. A row is resolved again when it is picked, so a menu left open still picks the right time.
Value and form
The value is read in time-zone (the browser’s zone by default), and valueAsDate gives the instant it names. A pick fires input, change and time-select, whose detail.preset is the row’s id (null from the panel). Under a name the form receives the value, required asks for one, and inside a c2-form-field the field’s label names the trigger.
<form>
<c2-form-field label="Follow up">
<c2-quick-time-menu name="followUp" required></c2-quick-time-menu>
</c2-form-field>
</form>Trigger
The trigger shows label until a time is chosen, then that time, with a clear button beside it (clearable="false" removes it). Put your own button in the trigger slot to change it entirely: the component writes no attribute on it, so give it aria-haspopup="menu" and keep its aria-expanded in step from the menu-toggle event (detail.open; expanded and :state(open) say the same). Set inline to draw the list without a trigger, inside a card, a sheet or another menu.
Accessibility
The list is a menu of menuitemradio rows, the chosen one checked, each named by its label and full date (“Tomorrow, Tuesday 10 November 2026 at 09:00”). Arrow Down or Up on the trigger opens it on the first or last row; inside, the arrow keys, Home, End and the first letter of a row move between rows, Enter or Space picks, and Escape closes the menu and returns focus to the trigger. A pick is announced.