Introduction
Installation
Next.jsViteLaravelReact RouterRemixAstroTanStack StartTanStack RouterManual InstallationMCP
All componentsTheme
FieldFormInputText FieldTextareaSearch FieldInput OTPNumber FieldNumber FormatSliderCheckboxSwitchRadioSelectCombo BoxList BoxChoice BoxMulti SelectToken FieldNewTag FieldTag GroupCalendarDate FieldDate PickerDate Range PickerRange CalendarTime FieldColor PickerColor FieldColor AreaColor SliderColor SwatchColor Swatch PickerColor ThumbColor WheelDrop ZoneFile Trigger
ButtonButton GroupToggleToggle GroupPreskok Auth Button
EditorHeadingLinkTextKeyboard
CardContainerGrid ListResizableTableTreeSeparatorDescription ListScroll AreaShow MoreToolbar
BreadcrumbsNavbarPaginationTabsSidebar
DialogModalDrawerPopoverPreview TriggerNewSheetTooltipContext MenuDropdownCommandCommand MenuDisclosureMenu
ToastProgress BarProgress CircleMeterLoaderSkeletonNoteBadge
Chart (helpers)Area ChartBar ChartLine ChartPie ChartExperimental ChartsNewExperimental Radial ChartNewExperimental Radar ChartNewBar ListTracker
Async ImageAvatarCarouselPreskok Icon
Forms

Calendar

Advanced date selection calendar with month/year navigation, date ranges, and internationalization support.

View as MarkdownAsk ChatGPT

Installation

npx shadcn@latest add @preskok/calendar

Usage

import { getLocalTimeZone, today } from "@internationalized/date"

import { Calendar } from "@/components/ui/preskok-ui/calendar"

export function CalendarDemo() {
  const [date, setDate] = useState(today(getLocalTimeZone()))

  return <Calendar value={date} onChange={setDate} aria-label="Select a date" />
}

Props

PropTypeDefaultDescription
valueDateValue | null-Selected date value
onChange(date: DateValue | null) => void-Date change handler
minValueDateValue-Minimum selectable date
maxValueDateValue-Maximum selectable date
isDisabledbooleanfalseDisable the entire calendar
isReadOnlybooleanfalseMake calendar read-only
isDateUnavailable(date: DateValue) => boolean-Function to disable specific dates
errorMessagestring-Error message to display
classNamestring-Additional CSS classes

Examples

Basic

Controlled

Controlled Month/Year

Disabled

Unavailable Dates

Min/Max Dates

Validation

Date Range

Multiple Months

Features

  • Single date selection - Select one date with clear focus and state handling
  • Month/year navigation - Dropdown selectors for quick navigation
  • Date validation - Min/max dates and custom unavailable dates
  • Internationalization - Full i18n support with locale-aware formatting
  • Keyboard navigation - Complete keyboard accessibility
  • Custom styling - Extensive customization options
  • Time zones - Proper time zone handling with @internationalized/date
  • Screen reader support - Comprehensive accessibility features

Accessibility

The Calendar component follows WAI-ARIA guidelines:

  • Proper grid structure with row/column headers
  • Keyboard navigation with arrow keys
  • Focus management and visual indicators
  • Screen reader announcements for date changes
  • Support for disabled and unavailable dates

Tag Group

A tag group component for displaying and managing tags.

Date Field

Input for entering and editing a date via segmented fields.

On this page

Installation
Usage
Props
Examples
Basic
Controlled
Controlled Month/Year
Disabled
Unavailable Dates
Min/Max Dates
Validation
Date Range
Multiple Months
Features
Accessibility