KANTO DS v1.12.0
Customise

Theme

Accent

Font

Corners

Density

Text size

Reset to Kanto
Forms

kt-calendar

GitHub Copy link

A month calendar to pick a day or a period from, shown in the page.

Preview

A month calendar to pick a day or a period from, shown in the page.

<kt-calendar value="2026-09-25"></kt-calendar> <kt-calendar range value="2026-09-07/2026-09-18" min="2026-01-01"></kt-calendar>

It is the calendar <kt-date-picker> opens in its popup. Use it on its own when the calendar is the interface — a booking page, a dashboard's date filter, a planning view — and <kt-date-picker> when it is only a way to fill a field.

A month and a year in two clicks

The title — "September 2026" — opens one panel: a scrolling list of years beside the twelve months of the one chosen. Pick the year, then the month, and the days are back, the day of the month kept: from 25 September, choosing March 1987 lands on 25 March 1987. The list opens on the chosen year, centred, and reaches from min to max — or, without them, 120 years back and 50 ahead, birthdays to plans. Typing four digits in the list jumps to that year. Months wholly outside min/max are disabled.

The arrows beside the title page a month at a time; they are the only thing that does.

Two months

months="2" shows two months side by side — what <kt-date-picker range> does, so a period across a month's end is two clicks. Each grid holds its own days only, so none shows twice, and the keyboard moves across both, paging only once it leaves the second.

Keyboard

In the days, the WAI-ARIA date grid pattern:

KeyDoes
← / →Previous / next day
↑ / ↓Same day, previous / next week
Home / EndFirst / last day of the week
Page Up / Page DownSame day, previous / next month
Shift + Page Up / DownSame day, previous / next year
Enter / SpaceChoose the day in focus

In the year list:

KeyDoes
↑ / ↓Previous / next year
Page Up / Page DownTen years back / ahead
Home / EndFirst / last year offered
Four digitsThat year
Enter, TabOn to the months
EscapeBack to the days — and no further, so an enclosing dialog stays open

In the months: the arrows, three to a row; Page Up/Page Down by year; Enter to choose; Escape back to the days.

Focus follows every switch, so the keys keep working without a click in between.

ISO values and locales

As for <kt-date-picker>: the value is ISO 8601 text — 2026-09-25, or 2026-09-07/2026-09-18 with range — and names, the first day of the week and every accessible label follow locale, else the page's lang, else the browser's language. A period takes two picks in either order and fires kt-change once, with the whole period.

<kt-calendar> is not a form control; inside a form, use <kt-date-picker>.

API

PropertyAttributeTypeDefault
valuevaluestring | nullnull
rangerangebooleanfalse
minminstring''
maxmaxstring''
monthsmonths1 | 21
localelocalestringpage, then browser
labellabelstringfrom setStrings
MethodDescription
focus()Focuses the current day — chosen, or today
EventDetail
kt-change{ value: string } — ISO date or interval
PartDescription
baseThe calendar
dayA day cell