logoAnt Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
6.1.0
  • Components Overview
  • Changelog
    v6.1.0
  • General
    • Button
    • FloatButton
      5.0.0
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
      5.10.0
    • Grid
    • Layout
    • Masonry
      6.0.0
    • Space
    • Splitter
      5.21.0
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
    • Tabs
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
      5.5.0
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
      DEPRECATED
    • Popover
    • QRCode
      5.1.0
    • Segmented
    • Statistic
    • Table
    • Tag
    • Timeline
    • Tooltip
    • Tour
      5.0.0
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
      5.1.0
  • Other
    • Affix
    • App
      5.1.0
    • ConfigProvider
    • Util
When To Use
Examples
Basic
Notice Calendar
Card
Selectable Calendar
Lunar Calendar
Show Week
Customize Header
Custom semantic dom styling
API
Semantic DOM
Design Token
FAQ
How to use Calendar with customize date library?
How to set locale for date-related components?
Date-related components locale is not working?
How to get date from panel click?

Calendar

A container that displays data in calendar form.
Importimport { Calendar } from 'antd';
GitHub
components/calendarIssueOpen issues
Docs
Edit this page
contributors
BadgeCard

Resources

Ant Design X
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
X
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference

Help

GitHub
Change Log
FAQ
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
WeaveFox logoWeaveFox-AI Development with WeaveFox 🦊
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

When To Use

When data is in the form of dates, such as schedules, timetables, prices calendar, lunar calendar. This component also supports Year/Month switch.

Examples

API

Common props ref:Common props

Note: Part of the Calendar's locale is read from value. So, please set the locale of dayjs correctly.

jsx
// The default locale is en-US, if you want to use other locale, just set locale in entry file globally.
// import dayjs from 'dayjs';
// import 'dayjs/locale/zh-cn';
// dayjs.locale('zh-cn');
<Calendar cellRender={cellRender} onPanelChange={onPanelChange} onSelect={onSelect} />
PropertyDescriptionTypeDefaultVersion
cellRenderCustomize cell contentfunction(current: dayjs, info: { prefixCls: string, originNode: React.ReactElement, today: dayjs, range?: 'start' | 'end', type: PanelMode, locale?: Locale, subType?: 'hour' | 'minute' | 'second' | 'meridiem' }) => React.ReactNode-5.4.0
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-
dateFullCellRenderCustomize the display of the date cell, the returned content will override the cellfunction(date: Dayjs): ReactNode-
fullCellRenderCustomize cell contentfunction(current: dayjs, info: { prefixCls: string, originNode: React.ReactElement, today: dayjs, range?: 'start' | 'end', type: PanelMode, locale?: Locale, subType?: 'hour' | 'minute' | 'second' | 'meridiem' }) => React.ReactNode-5.4.0
defaultValueThe date selected by defaultdayjs-
disabledDateFunction that specifies the dates that cannot be selected, currentDate is same dayjs object as value prop which you shouldn't mutate it](https://github.com/ant-design/ant-design/issues/30987)(currentDate: Dayjs) => boolean-
fullscreenWhether to display in full-screenbooleantrue
showWeekWhether to display week numberbooleanfalse5.23.0
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-
headerRenderRender custom header in panelfunction(object:{value: Dayjs, type: 'year' | 'month', onChange: f(), onTypeChange: f()})-
localeThe calendar's localeobject(default)
modeThe display mode of the calendarmonth | yearmonth
validRangeTo set valid range[dayjs, dayjs]-
valueThe current selected datedayjs-
onChangeCallback for when date changesfunction(date: Dayjs)-
onPanelChangeCallback for when panel changesfunction(date: Dayjs, mode: string)-
onSelectCallback for when a date is selected, include source infofunction(date: Dayjs, info: { source: 'year' | 'month' | 'date' | 'customize' })-info: 5.6.0

Semantic DOM

Design Token

Component TokenHow to use?
Token NameDescriptionTypeDefault Value
fullBgBackground color of full calendarstring#ffffff
fullPanelBgBackground color of full calendar panelstring#ffffff
itemActiveBgBackground color of selected date itemstring#e6f4ff
miniContentHeightHeight of mini calendar contentstring | number256
monthControlWidthWidth of month selectstring | number70
yearControlWidthWidth of year selectstring | number80
Global TokenHow to use?

FAQ

How to use Calendar with customize date library?

See Use custom date library

How to set locale for date-related components?

See How to set locale for date-related components

Date-related components locale is not working?

See FAQ Date-related-components-locale-is-not-working?

How to get date from panel click?

onSelect provide info.source to help on this:

tsx
<Calendar
onSelect={(date, { source }) => {
if (source === 'date') {
console.log('Panel Select:', source);
}
}}
/>
Basic

A basic calendar component with Year/Month switch.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Notice Calendar

This component can be rendered by using dateCellRender and monthCellRender with the data you need.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Card

Nested inside a container element for rendering in limited space.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Selectable Calendar

A basic calendar component with Year/Month switch.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Lunar Calendar

Display lunar calendar, solar terms and other information.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Show Week

Show week number in fullscreen calendar by setting showWeek prop to true.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
5.23.0
Customize Header

Customize Calendar header content.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom semantic dom styling

You can customize the semantic dom style of Calendar by passing objects/functions through classNames and styles.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
6.0.0
2025
Dec
SuMoTuWeThFrSa
30
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
01
02
03
04
05
06
07
08
09
10
2025
Dec
SuMoTuWeThFrSa
30
    01
      02
        03
          04
            05
              06
                07
                  08
                  • This is warning event.
                  • This is usual event.
                  09
                    10
                    • This is warning event.
                    • This is usual event.
                    • This is error event.
                    11
                      12
                        13
                          14
                            15
                            • This is warning event
                            • This is very long usual event......
                            • This is error event 1.
                            • This is error event 2.
                            • This is error event 3.
                            • This is error event 4.
                            16
                              17
                                18
                                  19
                                    20
                                      21
                                        22
                                          23
                                            24
                                              25
                                                26
                                                  27
                                                    28
                                                      29
                                                        30
                                                          31
                                                            01
                                                              02
                                                                03
                                                                  04
                                                                    05
                                                                      06
                                                                        07
                                                                          08
                                                                          • This is warning event.
                                                                          • This is usual event.
                                                                          09
                                                                            10
                                                                            • This is warning event.
                                                                            • This is usual event.
                                                                            • This is error event.
                                                                            2025
                                                                            Dec
                                                                            SuMoTuWeThFrSa
                                                                            30
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            12
                                                                            13
                                                                            14
                                                                            15
                                                                            16
                                                                            17
                                                                            18
                                                                            19
                                                                            20
                                                                            21
                                                                            22
                                                                            23
                                                                            24
                                                                            25
                                                                            26
                                                                            27
                                                                            28
                                                                            29
                                                                            30
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            You selected date: 2017-01-25
                                                                            2017
                                                                            Jan
                                                                            SuMoTuWeThFrSa
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            12
                                                                            13
                                                                            14
                                                                            15
                                                                            16
                                                                            17
                                                                            18
                                                                            19
                                                                            20
                                                                            21
                                                                            22
                                                                            23
                                                                            24
                                                                            25
                                                                            26
                                                                            27
                                                                            28
                                                                            29
                                                                            30
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            二〇二五年(乙巳蛇年)
                                                                            12月(十月)
                                                                            SuMoTuWeThFrSa
                                                                            30
                                                                            十一
                                                                            1
                                                                            十二
                                                                            2
                                                                            十三
                                                                            3
                                                                            十四
                                                                            4
                                                                            十五
                                                                            5
                                                                            十六
                                                                            6
                                                                            十七
                                                                            7
                                                                            大雪
                                                                            8
                                                                            十九
                                                                            9
                                                                            二十
                                                                            10
                                                                            廿一
                                                                            11
                                                                            廿二
                                                                            12
                                                                            廿三
                                                                            13
                                                                            廿四
                                                                            14
                                                                            廿五
                                                                            15
                                                                            廿六
                                                                            16
                                                                            廿七
                                                                            17
                                                                            廿八
                                                                            18
                                                                            廿九
                                                                            19
                                                                            三十
                                                                            20
                                                                            初一
                                                                            21
                                                                            冬至
                                                                            22
                                                                            初三
                                                                            23
                                                                            初四
                                                                            24
                                                                            初五
                                                                            25
                                                                            初六
                                                                            26
                                                                            初七
                                                                            27
                                                                            初八
                                                                            28
                                                                            初九
                                                                            29
                                                                            初十
                                                                            30
                                                                            十一
                                                                            31
                                                                            十二
                                                                            1
                                                                            元旦节
                                                                            2
                                                                            十四
                                                                            3
                                                                            十五
                                                                            4
                                                                            十六
                                                                            5
                                                                            小寒
                                                                            6
                                                                            十八
                                                                            7
                                                                            十九
                                                                            8
                                                                            二十
                                                                            9
                                                                            廿一
                                                                            10
                                                                            廿二
                                                                            2025
                                                                            Dec
                                                                            WeekSuMoTuWeThFrSa
                                                                            49
                                                                            30
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            50
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            12
                                                                            13
                                                                            51
                                                                            14
                                                                            15
                                                                            16
                                                                            17
                                                                            18
                                                                            19
                                                                            20
                                                                            52
                                                                            21
                                                                            22
                                                                            23
                                                                            24
                                                                            25
                                                                            26
                                                                            27
                                                                            1
                                                                            28
                                                                            29
                                                                            30
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            2
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10

                                                                            2025
                                                                            Dec
                                                                            WeekSuMoTuWeThFrSa
                                                                            49
                                                                            30
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            50
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            12
                                                                            13
                                                                            51
                                                                            14
                                                                            15
                                                                            16
                                                                            17
                                                                            18
                                                                            19
                                                                            20
                                                                            52
                                                                            21
                                                                            22
                                                                            23
                                                                            24
                                                                            25
                                                                            26
                                                                            27
                                                                            1
                                                                            28
                                                                            29
                                                                            30
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            2
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10

                                                                            Custom header

                                                                            2025
                                                                            Dec
                                                                            SuMoTuWeThFrSa
                                                                            30
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            12
                                                                            13
                                                                            14
                                                                            15
                                                                            16
                                                                            17
                                                                            18
                                                                            19
                                                                            20
                                                                            21
                                                                            22
                                                                            23
                                                                            24
                                                                            25
                                                                            26
                                                                            27
                                                                            28
                                                                            29
                                                                            30
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            2025
                                                                            Dec
                                                                            SuMoTuWeThFrSa
                                                                            30
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            12
                                                                            13
                                                                            14
                                                                            15
                                                                            16
                                                                            17
                                                                            18
                                                                            19
                                                                            20
                                                                            21
                                                                            22
                                                                            23
                                                                            24
                                                                            25
                                                                            26
                                                                            27
                                                                            28
                                                                            29
                                                                            30
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            2025
                                                                            Dec
                                                                            SuMoTuWeThFrSa
                                                                            30
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            12
                                                                            13
                                                                            14
                                                                            15
                                                                            16
                                                                            17
                                                                            18
                                                                            19
                                                                            20
                                                                            21
                                                                            22
                                                                            23
                                                                            24
                                                                            25
                                                                            26
                                                                            27
                                                                            28
                                                                            29
                                                                            30
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            2025
                                                                            Dec
                                                                            SuMoTuWeThFrSa
                                                                            30
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            12
                                                                            13
                                                                            14
                                                                            15
                                                                            16
                                                                            17
                                                                            18
                                                                            19
                                                                            20
                                                                            21
                                                                            22
                                                                            23
                                                                            24
                                                                            25
                                                                            26
                                                                            27
                                                                            28
                                                                            29
                                                                            30
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            • root
                                                                              6.0.0
                                                                              Root element containing background, border, border-radius and overall layout structure of the calendar component
                                                                            • header
                                                                              6.0.0
                                                                              Header element with layout and style control for year selector, month selector and mode switcher
                                                                            • body
                                                                              6.0.0
                                                                              Body element with padding and layout control for the calendar table that contains the calendar grid
                                                                            • content
                                                                              6.0.0
                                                                              Content element with width, height and table styling control for the calendar table
                                                                            • item
                                                                              6.0.0
                                                                              Item element with background, border, hover state, selected state and other interactive styles for calendar cells