JGuang

Calendar

Calendar · Arco Design

Preview
npm install @arco-design/web-react@2.66.18

Calendar

Container for displaying data in calendar form.

Install

npm install @arco-design/web-react@2.66.18

Import @arco-design/web-react/dist/css/arco.css at the entry and set the locale with ConfigProvider. React 19 projects must also import @arco-design/web-react/es/_util/react-19-adapter first, or imperative APIs such as Message and Modal cannot render.

Examples

  • Basic: Basic usage.
  • Dropdown: In addition to the default head switch, it also supports dropdown selection of heads for faster positioning.
  • Card Calendar: Use panel=true to display date in card format.

Examples come from the official Arco Design repository (MIT) at the commit published as npm 2.66.18. Some use online images or upload endpoints; network requests are disabled in previews.

API

Calendar

PropertyDescriptionTypeDefaultValue
allowSelectWhether to allow the selection and switching of the date. It's enabled by default in panel modeboolean-
isWeekSelect Week dateboolean-
panelWhether to be displayed in a container.boolean-
panelTodayBtnWhether to display the button to jump to todayboolean-
defaultModeThe default display mode of the calendar'day' | 'week' | 'month' | 'year'month
headerTypeThere are two types of headers to choose from. Only work in full-screen calendar mode.'button' | 'select'button
modeThe display mode of the calendar'day' | 'week' | 'month' | 'year'-
panelOperationsOperation buttons configuration in card modeArray<'left' | 'double-left' | 'right' | 'double-right'>-
classNameAdditional css classstring | string[]-
dayStartOfWeekThe first day of the week starts on the day of the week, 0-Sunday, 1-Monday.0 | 10
localeInternationalization configuration.Record<string, any>-
panelWidthThe width of the calendar in card modenumber | string265
styleAdditional styleCSSProperties-
dateInnerContentCustomize the date cell, the content will be added to the cell, and it will only work in the full-screen calendar mode.(currentDate: Dayjs) => ReactNode-
dateRenderCustomize the date display, which will completely cover the date cell.(currentDate: Dayjs) => ReactNode-
disabledDateFunction that specifies the dates that cannot be selected(current: Dayjs) => boolean-
headerRenderCustom header renderer.(props: {value?: Dayjs;pageShowDate?: Dayjs;mode?: string;onChange;onChangePageDate;onChangeMode;}) => ReactNode-
monthRenderCustomize the month display, which will completely cover the month cell.(currentDate: Dayjs) => ReactNode-
onChangeCallback when date change.(date: Dayjs) => void-
onPanelChangeCallback when the panel date changes.(date: Dayjs) => void-