Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Calendar

A date picker view for selecting a chrono::NaiveDate.

When To Use It

Use Calendar when users need day-based date selection in scheduling, booking, or reporting workflows.

Constructing a Calendar

use chrono::NaiveDate;
use vizia::prelude::*;

let date = Signal::new(NaiveDate::from_ymd_opt(2026, 4, 14).unwrap());

Calendar::new(cx, date).on_select(|cx, selected_date| {
    cx.emit(AppEvent::DateSelected(selected_date));
});

Calendar Modifiers

ModifierTypeDescriptionDefault
on_selectFn(&mut EventContext, NaiveDate)Called when a date is selected.-

Components and Styling

Calendar provides structured internal classes for common theming points.

SelectorDescription
calendarRoot calendar element.
calendar .calendar-controlsTop controls row (month/year navigation).
calendar .calendar-controls-selectMonth/year select controls area.
calendar .month-navMonth navigation buttons.
calendar .calendar-bodyMain body containing header and date grid.
calendar .calendar-headerDay-of-week header row.
calendar .calendar-dowIndividual day-of-week label.
calendar .calendar-dayIndividual date cell.
calendar .calendar-day-disabledCells outside current month / disabled days.
calendar .calendar-month-year-headingMonth and year text label in the controls row.
calendar .calendar-keyboard-helpKeyboard shortcut help element in the controls row.

Internally, Calendar uses Select controls for month and year pickers.

Accessibility

Calendar supports keyboard-focusable day cells and emits selected date changes through callback.

  • Provide external label context when needed.
  • Keep selected date synchronized in model state through on_select.
  • Ensure color contrast between selected, default, and disabled day states.

Keyboard Interaction

KeyAction
ArrowUp / ArrowDownMove focused date by one week backward/forward.
ArrowLeft / ArrowRightMove focused date by one day backward/forward.
HomeMove focus to the start of the current week.
EndMove focus to the end of the current week.
PageUp / PageDownMove focus by one month backward/forward.
Shift+PageUp / Shift+PageDownMove focus by one year backward/forward.
Enter / SpaceActivate/select the focused date.