Skip to main content
Tw Twintrinsic
  • Getting Started
  • Components
  • Theming
  • Completion
Examples
Data Dashboard Game Map
Core
App
Layout
Accordion AccordionItem Card Container Panel Separator Sidebar Splitter
Navigation
AppHeader BottomBar Breadcrumb BreadcrumbItem Menu MenuItem Tabs Tab TabList TabPanel TreeMenu
Data Display
Avatar AvatarGroup Badge Carousel CarouselItem Chip ChipGroup CodeBlock CodeBlockSpeed CodeEditor DataTable Map Progress Skeleton Table TableBody TableCell TableHead TableHeader TableRow Tag TagGroup Timeline TimelineItem Tooltip Tree TreeNode
Metrics
DonutChart PieChart LineChart BarChart HorizontalBarChart AreaChart StatsCard MetricGrid KPICard GaugeChart ProgressMetric MetricTrend
Form
AutoComplete Button ButtonGroup Calendar Checkbox ColorPicker Combobox Dropdown FileUpload FloatLabel Form FormField Input InputSwitch InvalidState Knob ListInput Listbox NumberInput Radio RadioGroup Rating Select SelectGroup Slider Switch TextInput Textarea
Feedback
Modal Stepper StepperStep Toast
Utility
Icon Lazy LazyPanel Masonry ThemeToggle

Calendar

The Calendar component is a date picker that supports single date and range selection, with keyboard navigation and accessibility features. It's built on top of the Input component and includes month navigation, week numbers, and customizable formatting.

Examples

Basic Usage

May 2026
SuMoTuWeThFrSa
<Calendar label="Select Date" />

Date Range Selection

May 2026
SuMoTuWeThFrSa
<Calendar
  label="Date Range"
  range={true}
  value={[new Date('2025-04-07'), new Date('2025-04-14')]}
/>

With Min/Max Dates

May 2026
SuMoTuWeThFrSa
<Calendar
  label="Date"
  minDate={new Date('2025-04-01')}
  maxDate={new Date('2025-04-30')}
/>

With Week Numbers

May 2026
WkSuMoTuWeThFrSa
18
19
20
21
22
<Calendar
  label="Date"
  showWeekNumbers={true}
/>

Props

PropTypeDefaultDescription
valueDate | [Date, Date] | nullnullSelected date or date range
rangebooleanfalseWhether to allow range selection
minDateDate | nullnullMinimum selectable date
maxDateDate | nullnullMaximum selectable date
showWeekNumbersbooleanfalseWhether to show week numbers
dayNamesstring[]['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']Custom day names
monthNamesstring[]['January', 'February', ...]Custom month names
labelstring'Date'Input label
formatstring'MM/dd/yyyy'Date format for display
disabledbooleanfalseWhether the calendar is disabled
classstring''Additional CSS classes

Events

EventDetail TypeDescription
onselect{ date: Date } | { start: Date, end: Date }Fired when a date or range is selected

Keyboard Navigation

The Calendar component supports keyboard navigation when the calendar is open:

  • ArrowLeft - Previous day
  • ArrowRight - Next day
  • ArrowUp - Previous week
  • ArrowDown - Next week
  • Enter - Select current date
  • Escape - Close calendar

Date Formatting

The format prop supports the following tokens:

  • MM - Month number (01-12)
  • dd - Day of the month (01-31)
  • yyyy - Full year

Examples:

  • MM/dd/yyyy - 04/07/2025
  • dd/MM/yyyy - 07/04/2025
  • yyyy-MM-dd - 2025-04-07

Accessibility

The Calendar component follows WAI-ARIA guidelines for date pickers:

  • Calendar opens in a dialog with proper ARIA labeling
  • Navigation buttons have descriptive labels
  • Date grid uses proper table semantics with row and column headers
  • Selected dates are indicated with aria-selected
  • Keyboard navigation support
  • Disabled dates are properly indicated