Expand description
Calendar — month-grid date picker, standalone widget.
A self-contained calendar with month/year navigation, a 6×7 day grid,
keyboard navigation matching the WAI-ARIA grid pattern, and full
AccessKit instrumentation (Role::Grid + per-cell Role::GridCell).
Used standalone for event apps and scheduling, and embedded in
DateEdit’s popover.
§Selection modes
Calendar::single— pick one day. Bound toSignal<Option<Date>>.Calendar::range— pick a start + end day. Bound toSignal<Option<DateRange>>. Click first day → click second day to commit. Escape mid-selection cancels the in-progress anchor.
§Behaviour
- Visible month is independent of the selection — navigating past the selected month doesn’t lose the selection.
- Today highlight draws a ring around today’s cell whenever it’s
in the visible month. Color comes from
TextRole::Accent. - Out-of-month cells (the leading days from the previous month
and trailing days from the next month that fill the 6×7 grid) are
rendered with
TextRole::Disabledand remain selectable (matching macOS / Material). To prevent selection usedisabled_date_filter. - Keyboard (matches the WAI-ARIA
gridpattern):- Arrow keys: move focus by one day.
- Home / End: first / last day of week.
- Ctrl+Home / Ctrl+End: first / last day of month.
- PageUp / PageDown: previous / next month.
- Shift+PageUp / Shift+PageDown: previous / next year.
- Enter / Space: commit focused day to selection.
- Escape: in range mode mid-selection, cancel anchor; otherwise bubble (popover hosts close).
T: jump focus to today.
§Accessibility
- Container —
Role::Gridwithset_label("Calendar, May 2026")(localized). Single-mode also setsset_valueto the current ISO selection or empty; range mode sets"start – end". - Header arrow buttons —
Role::Buttonwith localized labels (“Previous month”, “Next month”) andAction::Clickadvertised. - Header month/year label —
Role::Button(clickable to open the month picker) withset_has_popup(HasPopup::Grid)andset_expanded(open). - Weekday header row —
Role::RowofRole::ColumnHeadercells, each labelled with the long weekday name (e.g. “Monday”). - Day cells —
Role::GridCellwith localized long-form labels (“May 2, 2026”),set_selected,set_focused,set_disabledfor filter rejections, andAction::Clickadvertised.
§Example
ⓘ
use teksilo::widgets::{Calendar, common::datetime::Date};
let date = ctx.signal(Some(Date::constant(2026, 5, 2)));
ctx.add(
Calendar::single(date.clone())
.show_today_button(true)
.on_selection_changed(|d, ctx| ctx.send_intent(MyIntent::DateChanged(d))),
);Structs§
- Calendar
- Standalone month-grid date picker. See the module docs for the full feature list and a usage example.
- Date
Range - Inclusive range of two dates, with
start <= endenforced at construction. Used byCalendar::range.
Enums§
- Calendar
Mode - What the calendar body is showing — drives the WPF/Avalonia
“header-zoom” UX where clicking the title cycles to a coarser
grid, letting the user reach any year in 2-3 clicks instead of
many chevron presses. Default
CalendarMode::Days. - Week
Number Display - Whether and how week numbers are displayed in the leading column of the day grid.