Web · Components
Calendar
Month calendar.
Live example
Preview
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
Code
Events
- Events appear here when you interact with the preview.
Two months side by side, range and week numbers
| Wk | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|---|
| 45 | |||||||
| 46 | |||||||
| 47 | |||||||
| 48 | |||||||
| 49 | |||||||
| Wk | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|---|
| 49 | |||||||
| 50 | |||||||
| 51 | |||||||
| 52 | |||||||
| 53 | |||||||
Import
Month calendar. Selects a single day, a date range or several days; used on its own (e.g. on a booking page) or inside DatePicker and DateRangePicker.
- Language: month and day names and the first day of the week come from
UIProvider'slocaleviaIntl(defaulttr-TR: starts on Monday). - Navigation: clicking the month name in the header opens the month view, then the year view; distant dates are three clicks away. On touch screens, swiping left/right changes the month. Month transitions use a short slide animation (off with the reduced motion preference).
- Limits: days are disabled with
min,maxandisDateDisabled; in a range the length is limited withminDays/maxDays. - Keyboard: ←/→ day, ↑/↓ week, Home/End start/end of week, PageUp/ PageDown month (year with Shift), Enter/Space selects. The calendar is a single tab stop (WAI-ARIA grid).
- Range: the first click is the start, the second the end; the range is previewed while hovering in between.
- Today is shown with a ring and days in
markswith a dot below.
Values are ISO strings in "YYYY-MM-DD" format; no time zone shift.
Examples
Month calendar: shows the 12 months of a year in a grid and lets the user pick one. For selections that don't need a day, such as a billing period, a card expiry date or a monthly report. As a dropdown: MonthPicker.
- Clicking the year in the header opens the year grid; distant years are two clicks away. The ‹ › buttons change the year.
- Months are disabled with
min,maxandisMonthDisabled. - Keyboard: arrows move between cells, Enter/Space selects.
- Month names come from
UIProviderlocaleviaIntl.
Examples
Year calendar: picks a year in pages of 12 years (model year, graduation year, annual report). As a dropdown: YearPicker.
- The ‹ › buttons go 12 years forward/back; arrows navigate on the keyboard.
- Years are disabled with
min,maxandisYearDisabled.
Examples
toISODate
functionTurns a Date into an ISO date string in "YYYY-MM-DD" form (the day in local time). Values of the date components and FormData use this form.
Examples
parseISODate
functionTurns a "YYYY-MM-DD" (or "YYYY-MM-DDTHH:mm") string into a Date in local time; undefined when invalid. To read the value a DatePicker submits in a server action.
Examples
parseDateRange
functionSplits the "start/end" (ISO 8601 interval) value a DateRangePicker submits. When the format is broken, the ends are empty strings.
Examples
parseISOMonth
functionTurns the "YYYY-MM" value a MonthPicker submits into the first day of the month (local time); undefined when invalid.
Examples
CalendarClassNames
interfaceClasses that can be given to the inner parts of Calendar.
| Name | Type | Description |
|---|---|---|
month? | string | Container of each month. |
caption? | string | Month header (previous/next buttons and month name). |
grid? | string | Grid of days. |
day? | string | Each day button. |
CalendarBaseProps
interfaceProps shared by all selection modes of the calendar.
| Name | Type | Default | Description |
|---|---|---|---|
min? | DateInput | Earliest selectable day. Earlier days are faded and unselectable; previous months can't be reached. | |
max? | DateInput | Latest selectable day. | |
isDateDisabled? | (date: Date) => boolean | Function for days that can't be selected (e.g. weekends, booked days). Called for every visible day; keep it fast. | |
disabled? | boolean | The whole calendar is disabled. | |
readOnly? | boolean | Navigable, but the selection can't be changed. | |
month? | DateInput | Visible (first) month in controlled use; any day of the month can be given. onMonthChange (CalendarBaseProps.onMonthChange) is called when it changes. | |
defaultMonth? | DateInput | First visible month in uncontrolled use. Defaults to the selected day or today. | |
onMonthChange? | (month: string) => void | Called with the first day of the month ("2026-10-01") when the visible month changes. | |
months? | number | 1 | Number of months shown side by side (usually 2 for range selection). |
weekStartsOn? | 0 | 1 | 2 | 3 | 4 | 5 | 6 | First day of the week: 0 Sunday, 1 Monday … 6 Saturday. Chosen by locale when omitted (Monday for tr-TR, Sunday for en-US). | |
showWeekNumbers? | boolean | false | Show ISO week numbers at the start of rows? |
showOutsideDays? | boolean | true` for one month, `false` for multiple months | Show days outside the month (belonging to the previous/next month) faded? Clicking one moves to that month. |
fixedWeeks? | boolean | true | Always 6 rows per month? The height doesn't change between months. |
marks? | readonly DateInput[] | ((date: Date) => boolean) | Days that show a small dot below (e.g. events, appointments). A list of days or a function called for each day. | |
autoFocus? | boolean | On open, focus goes to the selected day (otherwise today). | |
id? | string | Id of the container. | |
aria-label? | string | "Takvim"` (`messages.calendar`) | Screen reader name. |
aria-labelledby? | string | Id of the element naming the calendar. | |
className? | string | Classes added to the container. | |
classNames? | CalendarClassNames | Classes added to the inner parts. |
SingleCalendarProps
interfaceCalendar selecting a single day.
| Name | Type | Default | Description |
|---|---|---|---|
mode? | "single" | "single" | Selection mode: "single" one day, "range" a range, "multiple" several days. |
value? | DateInput | Selected day in controlled use; "" for none. | |
defaultValue? | DateInput | Day selected initially in uncontrolled use. | |
onValueChange? | (value: string, date: Date | undefined) => void | Called with the ISO day ("2026-10-28") and a Date when the selection changes. | |
min? | DateInput | Earliest selectable day. Earlier days are faded and unselectable; previous months can't be reached. | |
max? | DateInput | Latest selectable day. | |
isDateDisabled? | (date: Date) => boolean | Function for days that can't be selected (e.g. weekends, booked days). Called for every visible day; keep it fast. | |
disabled? | boolean | The whole calendar is disabled. | |
readOnly? | boolean | Navigable, but the selection can't be changed. | |
month? | DateInput | Visible (first) month in controlled use; any day of the month can be given. onMonthChange (CalendarBaseProps.onMonthChange) is called when it changes. | |
defaultMonth? | DateInput | First visible month in uncontrolled use. Defaults to the selected day or today. | |
onMonthChange? | (month: string) => void | Called with the first day of the month ("2026-10-01") when the visible month changes. | |
months? | number | 1 | Number of months shown side by side (usually 2 for range selection). |
weekStartsOn? | 0 | 1 | 2 | 3 | 4 | 5 | 6 | First day of the week: 0 Sunday, 1 Monday … 6 Saturday. Chosen by locale when omitted (Monday for tr-TR, Sunday for en-US). | |
showWeekNumbers? | boolean | false | Show ISO week numbers at the start of rows? |
showOutsideDays? | boolean | true` for one month, `false` for multiple months | Show days outside the month (belonging to the previous/next month) faded? Clicking one moves to that month. |
fixedWeeks? | boolean | true | Always 6 rows per month? The height doesn't change between months. |
marks? | readonly DateInput[] | ((date: Date) => boolean) | Days that show a small dot below (e.g. events, appointments). A list of days or a function called for each day. | |
autoFocus? | boolean | On open, focus goes to the selected day (otherwise today). | |
id? | string | Id of the container. | |
aria-label? | string | "Takvim"` (`messages.calendar`) | Screen reader name. |
aria-labelledby? | string | Id of the element naming the calendar. | |
className? | string | Classes added to the container. | |
classNames? | CalendarClassNames | Classes added to the inner parts. |
RangeCalendarProps
interfaceCalendar selecting a date range.
| Name | Type | Default | Description |
|---|---|---|---|
mode | "range" | The first click selects the start, the second the end. | |
value? | DateRangeInput | Selected range in controlled use. | |
defaultValue? | DateRangeInput | Initial range in uncontrolled use. | |
onValueChange? | (range: DateRange) => void | Called when the selection changes; end is empty until the end is selected. | |
minDays? | number | Minimum number of days in the range (both ends included). | |
maxDays? | number | Maximum number of days in the range (both ends included); far days are disabled once the start is selected. | |
min? | DateInput | Earliest selectable day. Earlier days are faded and unselectable; previous months can't be reached. | |
max? | DateInput | Latest selectable day. | |
isDateDisabled? | (date: Date) => boolean | Function for days that can't be selected (e.g. weekends, booked days). Called for every visible day; keep it fast. | |
disabled? | boolean | The whole calendar is disabled. | |
readOnly? | boolean | Navigable, but the selection can't be changed. | |
month? | DateInput | Visible (first) month in controlled use; any day of the month can be given. onMonthChange (CalendarBaseProps.onMonthChange) is called when it changes. | |
defaultMonth? | DateInput | First visible month in uncontrolled use. Defaults to the selected day or today. | |
onMonthChange? | (month: string) => void | Called with the first day of the month ("2026-10-01") when the visible month changes. | |
months? | number | 1 | Number of months shown side by side (usually 2 for range selection). |
weekStartsOn? | 0 | 1 | 2 | 3 | 4 | 5 | 6 | First day of the week: 0 Sunday, 1 Monday … 6 Saturday. Chosen by locale when omitted (Monday for tr-TR, Sunday for en-US). | |
showWeekNumbers? | boolean | false | Show ISO week numbers at the start of rows? |
showOutsideDays? | boolean | true` for one month, `false` for multiple months | Show days outside the month (belonging to the previous/next month) faded? Clicking one moves to that month. |
fixedWeeks? | boolean | true | Always 6 rows per month? The height doesn't change between months. |
marks? | readonly DateInput[] | ((date: Date) => boolean) | Days that show a small dot below (e.g. events, appointments). A list of days or a function called for each day. | |
autoFocus? | boolean | On open, focus goes to the selected day (otherwise today). | |
id? | string | Id of the container. | |
aria-label? | string | "Takvim"` (`messages.calendar`) | Screen reader name. |
aria-labelledby? | string | Id of the element naming the calendar. | |
className? | string | Classes added to the container. | |
classNames? | CalendarClassNames | Classes added to the inner parts. |
MultipleCalendarProps
interfaceCalendar selecting multiple days.
| Name | Type | Default | Description |
|---|---|---|---|
mode | "multiple" | Each click selects or deselects a day. | |
value? | readonly DateInput[] | Selected days in controlled use. | |
defaultValue? | readonly DateInput[] | Days selected initially in uncontrolled use. | |
onValueChange? | (values: string[], dates: Date[]) => void | Called with sorted ISO days and Dates when the selection changes. | |
min? | DateInput | Earliest selectable day. Earlier days are faded and unselectable; previous months can't be reached. | |
max? | DateInput | Latest selectable day. | |
isDateDisabled? | (date: Date) => boolean | Function for days that can't be selected (e.g. weekends, booked days). Called for every visible day; keep it fast. | |
disabled? | boolean | The whole calendar is disabled. | |
readOnly? | boolean | Navigable, but the selection can't be changed. | |
month? | DateInput | Visible (first) month in controlled use; any day of the month can be given. onMonthChange (CalendarBaseProps.onMonthChange) is called when it changes. | |
defaultMonth? | DateInput | First visible month in uncontrolled use. Defaults to the selected day or today. | |
onMonthChange? | (month: string) => void | Called with the first day of the month ("2026-10-01") when the visible month changes. | |
months? | number | 1 | Number of months shown side by side (usually 2 for range selection). |
weekStartsOn? | 0 | 1 | 2 | 3 | 4 | 5 | 6 | First day of the week: 0 Sunday, 1 Monday … 6 Saturday. Chosen by locale when omitted (Monday for tr-TR, Sunday for en-US). | |
showWeekNumbers? | boolean | false | Show ISO week numbers at the start of rows? |
showOutsideDays? | boolean | true` for one month, `false` for multiple months | Show days outside the month (belonging to the previous/next month) faded? Clicking one moves to that month. |
fixedWeeks? | boolean | true | Always 6 rows per month? The height doesn't change between months. |
marks? | readonly DateInput[] | ((date: Date) => boolean) | Days that show a small dot below (e.g. events, appointments). A list of days or a function called for each day. | |
autoFocus? | boolean | On open, focus goes to the selected day (otherwise today). | |
id? | string | Id of the container. | |
aria-label? | string | "Takvim"` (`messages.calendar`) | Screen reader name. |
aria-labelledby? | string | Id of the element naming the calendar. | |
className? | string | Classes added to the container. | |
classNames? | CalendarClassNames | Classes added to the inner parts. |
CalendarProps
typeProps of the Calendar component.
| Name | Type | Default | Description |
|---|---|---|---|
mode? | "single" | "range" | "multiple" | "single" | Selection mode: "single" one day, "range" a range, "multiple" several days. |
value? | DateInput | DateRangeInput | readonly DateInput[] | Selected day in controlled use; "" for none. | |
defaultValue? | DateInput | DateRangeInput | readonly DateInput[] | Day selected initially in uncontrolled use. | |
onValueChange? | (value: string, date: Date | undefined) => void | (range: DateRange) => void | (values: string[], dates: Date[]) => void | Called with the ISO day ("2026-10-28") and a Date when the selection changes. | |
min? | DateInput | Earliest selectable day. Earlier days are faded and unselectable; previous months can't be reached. | |
max? | DateInput | Latest selectable day. | |
isDateDisabled? | (date: Date) => boolean | Function for days that can't be selected (e.g. weekends, booked days). Called for every visible day; keep it fast. | |
disabled? | boolean | The whole calendar is disabled. | |
readOnly? | boolean | Navigable, but the selection can't be changed. | |
month? | DateInput | Visible (first) month in controlled use; any day of the month can be given. onMonthChange (CalendarBaseProps.onMonthChange) is called when it changes. | |
defaultMonth? | DateInput | First visible month in uncontrolled use. Defaults to the selected day or today. | |
onMonthChange? | (month: string) => void | Called with the first day of the month ("2026-10-01") when the visible month changes. | |
months? | number | 1 | Number of months shown side by side (usually 2 for range selection). |
weekStartsOn? | 0 | 1 | 2 | 3 | 4 | 5 | 6 | First day of the week: 0 Sunday, 1 Monday … 6 Saturday. Chosen by locale when omitted (Monday for tr-TR, Sunday for en-US). | |
showWeekNumbers? | boolean | false | Show ISO week numbers at the start of rows? |
showOutsideDays? | boolean | true` for one month, `false` for multiple months | Show days outside the month (belonging to the previous/next month) faded? Clicking one moves to that month. |
fixedWeeks? | boolean | true | Always 6 rows per month? The height doesn't change between months. |
marks? | readonly DateInput[] | ((date: Date) => boolean) | Days that show a small dot below (e.g. events, appointments). A list of days or a function called for each day. | |
autoFocus? | boolean | On open, focus goes to the selected day (otherwise today). | |
id? | string | Id of the container. | |
aria-label? | string | "Takvim"` (`messages.calendar`) | Screen reader name. |
aria-labelledby? | string | Id of the element naming the calendar. | |
className? | string | Classes added to the container. | |
classNames? | CalendarClassNames | Classes added to the inner parts. | |
minDays? | number | Minimum number of days in the range (both ends included).(RangeCalendarProps) | |
maxDays? | number | Maximum number of days in the range (both ends included); far days are disabled once the start is selected.(RangeCalendarProps) |
DateInput
typeType of props that take a date: an ISO date string like "2026-10-28" or a Date. For a Date, the day in local time is used.
DateRange
interfaceA date range. Values are ISO date strings in "YYYY-MM-DD" form; an unselected end is an empty string ("").
| Name | Type | Description |
|---|---|---|
start | string | Start day. |
end | string | End day (the start is included). |
DateRangeInput
interfaceType of props that take a range; ends may be strings or Dates.
| Name | Type | Description |
|---|---|---|
start? | DateInput | null | Start day. |
end? | DateInput | null | End day. |
YearInput
typeForms accepted by YearPicker and YearCalendar values: 2026, "2026" or Date.
MonthCalendarProps
interfaceProps of the MonthCalendar component.
| Name | Type | Default | Description |
|---|---|---|---|
value? | DateInput | Selected month in controlled use: "2026-10", any day of the month ("2026-10-28") or a Date; "" for none. | |
defaultValue? | DateInput | Month selected initially in uncontrolled use. | |
onValueChange? | (value: string, date: Date | undefined) => void | Called with "YYYY-MM" and the first day of the month (Date) when the selection changes. | |
min? | DateInput | Earliest selectable month ("2026-01" or a date). | |
max? | DateInput | Latest selectable month. | |
isMonthDisabled? | (date: Date) => boolean | Function for months that can't be selected; called with the first day of the month (e.g. closed accounting periods). | |
monthFormat? | "short" | "long" | "numeric" | "short" | Format of month names: "short" ("Oct"), "long" ("October") or "numeric" ("10"). |
defaultYear? | number | First visible year in uncontrolled use. Defaults to the selected month or this year. | |
onYearChange? | (year: number) => void | Called when the visible year changes. | |
disabled? | boolean | Entirely disabled. | |
readOnly? | boolean | Navigable, but the selection can't be changed. | |
autoFocus? | boolean | On open, focus goes to the selected cell (otherwise this month/year). | |
id? | string | Id of the container. | |
aria-label? | string | "Takvim"` (`messages.calendar`) | Screen reader name. |
aria-labelledby? | string | Id of the element naming the calendar. | |
className? | string | Classes added to the container. |
YearCalendarProps
interfaceProps of the YearCalendar component.
| Name | Type | Default | Description |
|---|---|---|---|
value? | YearInput | Selected year in controlled use: 2026, "2026" or a Date; "" for none. | |
defaultValue? | YearInput | Year selected initially in uncontrolled use. | |
onValueChange? | (value: string, year: number | undefined) => void | Called with the "YYYY" string and the year number when the selection changes ("", undefined when cleared). | |
min? | YearInput | Earliest selectable year. | |
max? | YearInput | Latest selectable year. | |
isYearDisabled? | (year: number) => boolean | Function for years that can't be selected. | |
disabled? | boolean | Entirely disabled. | |
readOnly? | boolean | Navigable, but the selection can't be changed. | |
autoFocus? | boolean | On open, focus goes to the selected cell (otherwise this month/year). | |
id? | string | Id of the container. | |
aria-label? | string | "Takvim"` (`messages.calendar`) | Screen reader name. |
aria-labelledby? | string | Id of the element naming the calendar. | |
className? | string | Classes added to the container. |