logoAnt Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
YouMindTRACTIANLobeHubCodeRabbit
6.4.5
  • Components Overview
  • Changelog
    v6.4.5
  • General
    • Button
    • FloatButton
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
    • Grid
    • Layout
    • Masonry
      6.0.0
    • Space
    • Splitter
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
    • Tabs
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
    • 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
    • Segmented
    • Statistic
    • Table
    • Tag
    • Timeline
    • Tooltip
    • Tour
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
  • Other
    • Affix
    • App
    • BorderBeam
      6.4.0
    • ConfigProvider
    • Util
When To Use
Examples
Basic
Notice Calendar
Event Range
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 pageLLMs.md
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
For Agents
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} />
PropertyDescriptionTypeDefaultVersionGlobal Config
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>-6.0.0
dateFullCellRenderCustomize the display of the date cell, the returned content will override the cell. Please use fullCellRender instead in 5.4.0 and laterfunction(date: Dayjs): ReactNode-< 5.4.0×
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>-6.0.0
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?
Token NameDescriptionTypeDefault Value
colorBgContainerContainer background color, e.g: default button, input box, etc. Be sure not to confuse this with `colorBgElevated`.string#ffffff
colorFillSecondaryThe second level of fill color can outline the shape of the element more clearly, such as Rate, Skeleton, etc. It can also be used as the Hover state of the third level of fill color, such as Table, etc.stringrgba(0,0,0,0.06)
colorIconWeak action. Such as `allowClear` or Alert close buttonstringrgba(0,0,0,0.45)
colorIconHoverWeak action hover color. Such as `allowClear` or Alert close buttonstringrgba(0,0,0,0.88)
colorPrimaryBrand color is one of the most direct visual elements to reflect the characteristics and communication of the product. After you have selected the brand color, we will automatically generate a complete color palette and assign it effective design semantics.string#1677ff
colorSplitUsed as the color of separator, this color is the same as colorBorderSecondary but with transparency.stringrgba(5,5,5,0.06)
colorTextDefault text color which comply with W3C standards, and this color is also the darkest neutral color.stringrgba(0,0,0,0.88)
colorTextDisabledControl the color of text in disabled state.stringrgba(0,0,0,0.25)
colorTextHeadingControl the font color of heading.stringrgba(0,0,0,0.88)
colorTextLightSolidControl the highlight color of text with background color, such as the text in Primary Button components.string#fff
colorTextTertiaryThe third level of text color is generally used for descriptive text, such as form supplementary explanation text, list descriptive text, etc.stringrgba(0,0,0,0.45)
borderRadiusLGLG size border radius, used in some large border radius components, such as Card, Modal and other components.number8
borderRadiusSMSM size border radius, used in small size components, such as Button, Input, Select and other input components in small sizenumber4
controlHeightLGLG component heightnumber40
controlHeightSMSM component heightnumber24
controlItemBgActiveControl the background color of control component item when active.string#e6f4ff
controlItemBgHoverControl the background color of control component item when hovering.stringrgba(0,0,0,0.04)
fontFamilyThe font family of Ant Design prioritizes the default interface font of the system, and provides a set of alternative font libraries that are suitable for screen display to maintain the readability and readability of the font under different platforms and browsers, reflecting the friendly, stable and professional characteristics.string-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'
fontSizeThe most widely used font size in the design system, from which the text gradient will be derived.number14
fontWeightStrongControl the font weight of heading components (such as h1, h2, h3) or selected item.number600
lineHeightLine height of text.number1.5714285714285714
lineTypeBorder style of base componentsstringsolid
lineWidthBorder width of base componentsnumber1
lineWidthBoldThe default line width of the outline class components, such as Button, Input, Select, etc.number2
marginXSControl the margin of an element, with a small size.number8
marginXXSControl the margin of an element, with the smallest size.number4
motionDurationMidMotion speed, medium speed. Used for medium element animation interaction.string0.2s
motionDurationSlowMotion speed, slow speed. Used for large element animation interaction.string0.3s
paddingControl the padding of the element.number16
paddingSMControl the small padding of the element.number12
paddingXSControl the extra small padding of the element.number8
paddingXXSControl the extra extra small padding of the element.number4
screenXSControl the screen width of extra small screens.number480

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
Event Range

Render event ranges across days with cellRender. The example calculates whether each date is the start, middle, end, or a single-day event and draws compact range bars.

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
2026
Jun
SuMoTuWeThFrSa
31
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
01
02
03
04
05
06
07
08
09
10
11
2026
Jun
SuMoTuWeThFrSa
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.
                    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
                                                          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
                                                                            2026
                                                                            Jan
                                                                            SuMoTuWeThFrSa
                                                                            28
                                                                            29
                                                                            30
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            Release window
                                                                            09
                                                                            10
                                                                            11
                                                                            12
                                                                            13
                                                                            14
                                                                            Design review
                                                                            15
                                                                            16
                                                                            17
                                                                            18
                                                                            19
                                                                            20
                                                                            21
                                                                            Maintenance
                                                                            22
                                                                            23
                                                                            24
                                                                            25
                                                                            26
                                                                            27
                                                                            28
                                                                            29
                                                                            30
                                                                            Bug fix
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            2026
                                                                            Jun
                                                                            SuMoTuWeThFrSa
                                                                            31
                                                                            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
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            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
                                                                            二〇二六年(丙午马年)
                                                                            6月(四月)
                                                                            SuMoTuWeThFrSa
                                                                            31
                                                                            十五
                                                                            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
                                                                            十六
                                                                            1
                                                                            十七
                                                                            2
                                                                            十八
                                                                            3
                                                                            十九
                                                                            4
                                                                            二十
                                                                            5
                                                                            廿一
                                                                            6
                                                                            廿二
                                                                            7
                                                                            小暑
                                                                            8
                                                                            廿四
                                                                            9
                                                                            廿五
                                                                            10
                                                                            廿六
                                                                            11
                                                                            廿七
                                                                            2026
                                                                            Jun
                                                                            WeekSuMoTuWeThFrSa
                                                                            23
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            24
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            12
                                                                            13
                                                                            25
                                                                            14
                                                                            15
                                                                            16
                                                                            17
                                                                            18
                                                                            19
                                                                            20
                                                                            26
                                                                            21
                                                                            22
                                                                            23
                                                                            24
                                                                            25
                                                                            26
                                                                            27
                                                                            27
                                                                            28
                                                                            29
                                                                            30
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            28
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11

                                                                            2026
                                                                            Jun
                                                                            WeekSuMoTuWeThFrSa
                                                                            23
                                                                            31
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            24
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            12
                                                                            13
                                                                            25
                                                                            14
                                                                            15
                                                                            16
                                                                            17
                                                                            18
                                                                            19
                                                                            20
                                                                            26
                                                                            21
                                                                            22
                                                                            23
                                                                            24
                                                                            25
                                                                            26
                                                                            27
                                                                            27
                                                                            28
                                                                            29
                                                                            30
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            28
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11

                                                                            Custom header

                                                                            2026
                                                                            Jun
                                                                            SuMoTuWeThFrSa
                                                                            31
                                                                            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
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            2026
                                                                            Jun
                                                                            SuMoTuWeThFrSa
                                                                            31
                                                                            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
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            2026
                                                                            Jun
                                                                            SuMoTuWeThFrSa
                                                                            31
                                                                            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
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            2026
                                                                            Jun
                                                                            SuMoTuWeThFrSa
                                                                            31
                                                                            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
                                                                            01
                                                                            02
                                                                            03
                                                                            04
                                                                            05
                                                                            06
                                                                            07
                                                                            08
                                                                            09
                                                                            10
                                                                            11
                                                                            • 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
                                                                            • itemContent
                                                                              6.4.0
                                                                              Item content element with height, overflow and other style control for custom content area inside calendar cells