- Docs
- Components
- Dates
Calendar
A month to choose a day from, on the WAI-ARIA date grid. Dates are "YYYY-MM-DD", with no library.
- Import
- @qeetrix/react/experimental
- Status
- ExperimentalSince 0.0.6
- Renders
<table role="grid">Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Import
// Experimental: from the package's experimental entry, until it's stable.
import { Calendar } from "@qeetrix/react/experimental";02
Props
And every native attribute of the element it renders.
| Prop | Type | Default | What it does |
|---|---|---|---|
value · defaultValue | string | null | null | The chosen day, "YYYY-MM-DD". |
onValueChange | (value: string) => void | — | Called with the chosen day. |
min · max | string | — | The earliest and latest days, "YYYY-MM-DD". |
isDateDisabled | (date: string) => boolean | — | Rules out more days: weekends, holidays. |
defaultMonth | string | today's month | The month shown first when nothing's chosen, "YYYY-MM". |
locale | string | the provider's | The language and the week's first day (Sunday for India). |
today | string | the browser's | Today, for tests and screenshots. |
autoFocus | boolean | false | Focuses the focusable day as it mounts: in a picker that opens. |
disabled | boolean | false | Nothing can be chosen and the month stays put; still focusable, to be read. |
readOnly | boolean | false | The months can be browsed; no day can be chosen. |
messages | Partial<…calendar> | — | Its words, over QeetrixProvider's. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What it is |
|---|---|---|
calendar | <div> | The root. |
calendar-header | <div> | calendar-previous, calendar-title and calendar-next. |
calendar-grid | <table role="grid"> | The month: calendar-weekday heads, calendar-cell cells. |
calendar-day | <button> | A day: data-date, data-today, data-outside; its calendar-cell carries aria-selected. |
calendar-zoom | <button> | The title's button: it opens the years, then the months; calendar-option each. |
04
Days a console rules out
isDateDisabled with min: from today, weekdays, not on holidays.
const holidays = new Set(["2026-10-02", "2026-10-20", "2026-11-08"]);
const isWeekend = (date: string) => [0, 6].includes(new Date(`${date}T00:00:00Z`).getUTCDay());
<Calendar min={today} isDateDisabled={(date) => isWeekend(date) || holidays.has(date)} />