Calendar

A date selection component supporting single dates and date ranges. Includes keyboard navigation, screen reader support, and multi-brand theming.

Mon Tue Wed Thu Fri Sat Sun

Usage

The Calendar component enables date selection in forms, filters, and booking flows. It supports single date selection and date range selection.

States

PreviewStateDescription
Default Neutral day cell.
Hover Visual feedback on pointer hover.
Focus Visible focus ring for keyboard navigation.
Selected Active selected date.
Range Start, middle, and end cells for date range selection.
Outside month Date from the previous or next month shown for context.
Disabled Date outside the selectable range.

Keyboard interactions

KeyInteraction
ArrowLeft or ArrowRight Moves focus one day backward or forward.
ArrowUp or ArrowDown Moves focus one week backward or forward.
Home or End Moves focus to the first or last day in the current week.
PageUp or PageDown Moves focus to the previous or next month.
Enter or Space Selects the focused date.

Accessibility

  • Uses role="grid" for the day grid
  • Each cell has an aria-label with the full date (e.g. "15 July 2026")
  • Focus management follows roving tabindex pattern
  • Minimum 44×44px touch target per cell
  • Contrast validated for all states and modes

Anatomy

1 2 3 4
Mon Tue Wed Thu Fri Sat Sun
  1. 1 Calendar container — optional bordered surface added with .has-container
  2. 2 Header — previous/next actions and month/year selects
  3. 3 Weekday row — column labels for the grid
  4. 4 Day cell — selectable date button with selected, today, disabled, and range states

Options

Table of options

PropertyValuesDefault
containertrue / falsetrue
selectedDateday number / none
rangeStartday number / none
rangeEndday number / none
todayDateday number / none1
statedefault / hover / focusdefault
disabledtrue / falsefalse

Variants

Mon Tue Wed Thu Fri Sat Sun
Container
Mon Tue Wed Thu Fri Sat Sun
No container
Mon Tue Wed Thu Fri Sat Sun
Range
Mon Tue Wed Thu Fri Sat Sun
Disabled

Tokens

TokenPurpose
--calendar-container-paddingContainer padding
--calendar-container-border-radiusContainer border radius
--calendar-container-border-colorContainer border color
--calendar-container-border-sizeContainer border width
--calendar-container-backgroundContainer background
--calendar-container-gapVertical gap between calendar sections
--calendar-header-gapGap between header controls
--calendar-weekday-text-colorWeekday label color
--calendar-weekday-font-sizeWeekday label font size
--calendar-weekday-heightWeekday label row height
--calendar-cell-gapSpacing around day cells
--calendar-cell-min-sizeMinimum day cell touch target
--calendar-cell-border-radiusDay cell radius
--calendar-cell-text-color-defaultDefault day cell text
--calendar-cell-text-color-activeSelected day cell text
--calendar-cell-text-color-disabledDisabled and outside-month text
--calendar-cell-background-activeSelected day cell background
--calendar-cell-background-hoverHover state
--calendar-cell-range-border-colorRange and today indicator border color
--calendar-cell-range-border-sizeRange and today indicator border width
--calendar-cell-range-border-radiusRange start/end radius