What it does
The calendar renders one or more month grids with single, multiple, or range selection. Range mode paints hover previews between the endpoints, supports minimum and maximum spans, and swaps endpoints automatically when the second pick is earlier than the first.
Every label — weekday headers, month captions, and day digits — is produced by Intl.DateTimeFormat, so ar-EG renders Arabic-Indic digits and de-DE starts weeks on Monday without configuration.
Composition and API
Selection and the visible month are both controllable. Constrain interaction with minDate/maxDate bounds and disabled matchers (dates, ranges, weekdays, or predicates), render custom day content with renderDay, and switch the caption to month/year dropdowns for birthday-style jumps. The animated entry (imported from the /animated subpath) adds framer-motion month transitions.
Common use cases
- Inline booking calendars with disabled and price-annotated days.
- Date range selection for reports, analytics filters, and stays.
- Multi-date selection for shift planning and event scheduling.
- Localized calendars that follow the user's language and numbering system.
Accessibility
The grid uses table semantics with role="grid", column headers with long-form abbreviations, aria-selected day cells, and aria-current on today. Disabled days stay focusable but not selectable, matching the ARIA date-grid guidance.
This preview page exposes a single h1 in the hero for a clean outline.
Next.js integration notes
Pass explicit today and locale props in SSR-critical paths so server and client render the same grid. Keep interactive calendars in client components.
Set NEXT_PUBLIC_SITE_URL so canonical and Open Graph URLs resolve on deploy.
FAQ
Does the Calendar component need date-fns or dayjs?
No. All date math is plain Date arithmetic and all localization comes from Intl.DateTimeFormat and Intl.Locale — the component adds zero dependencies.
Is the Calendar keyboard accessible?
Yes. It implements the ARIA grid pattern with a roving tabindex: arrow keys move by day and week, Home/End jump within the week, PageUp/PageDown move months, and Shift+PageUp/PageDown move years.
Can I customize the calendar with Tailwind CSS?
Zentauri UI exposes class-friendly variants, data-state attributes, and --zui-calendar-* CSS variables so you can extend styles with Tailwind utilities without fighting inline styles.