Skip to content

Calendar

A month grid on react-day-picker with Keyline chevrons.

A month to place in a card or a popover, for one date, several dates or a range. For a date field with its own popover, use @khaeli/date-picker. Pass a locale from react-day-picker/locale: it sets the language of the names, the first day of the week and the format of each day's data-day, the same on the server and in the browser.

One date

March 2026

Date range

March 2026

Two months

March 2026
April 2026

Month and year menus

March 2026

Days that cannot be picked

March 2026

Week numbers

March 2026
09
10
11
12
13
14

Installation

npx shadcn@latest add @khaeli/calendar

Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.

Installs with

npm packages
  • @keyline-icons/react ^2.2.0
  • react-day-picker ^10.0.1

Keyboard

Tab
Moves to the previous-month and next-month buttons, then into the days. One day is in the tab order: the chosen day, else today, else the first of the month.
ArrowLeftArrowRight
Move focus to the day before and the day after. Days that cannot be picked are skipped.
ArrowUpArrowDown
Move focus to the same weekday in the week before and the week after.
HomeEnd
Move focus to the start and to the end of the week.
PageUpPageDown
Move focus to the same day in the month before and the month after.
Shift + PageUpShift + PageDown
Move focus to the same day in the year before and the year after.
EnterSpace
Choose the focused day. Focus stays on it.

Accessible name

  • The grid is named by the month it shows, such as "March 2026".
  • Each day is a button named in full, such as "Thursday, 12 March 2026", with "Today" and "selected" added where they apply.
  • The month buttons are named "Go to the Previous Month" and "Go to the Next Month". With captionLayout="dropdown" the menus are named "Choose the Month" and "Choose the Year".
  • The month buttons sit in a nav landmark named "Navigation bar". Where a page shows more than one calendar, name each one for its date: labels={{ labelNav: () => "Due date months" }}.
  • Selection is not conveyed by colour alone: the chosen day's name says "selected". A day that cannot be picked is a disabled button.

Registry JSON

The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/calendar.json