Ant Design Svelte

Calendar

Schedules and events in a complete and compact calendar.

When to use

Calendar displays schedules, events, or metrics by calendar day. In month mode you can see the days of the month, in year mode you can see the months of the year. To select a date in a compact field, use DatePicker.

fullscreen=false embeds a mini-calendar into the card. Events and bars of several days are drawn from the application data; they do not change a single Calendar value to a range.

At viewport widths up to 480 px, the year and month selectors share a row in month view. The mode switch sits below them.

Date and panel mode

Regular Calendar works with Dayjs. With value, the application accepts the new date via onChange; without value, defaultValue or the current date is used. The managed mode is updated separately from the value.

Problem Setting Example
Show full calendar defaultValue Basic calendar
Associate the selected date with the state value, onChange, onSelect Guided Choice
Embed mini calendar fullscreen={false} Calendar in a card
Show week numbers showWeek Week numbers
Limit available dates validRange, disabledDate Valid working dates

onChange reports a date change, onPanelChange reports the date or panel mode, onSelect reports a selection with the source date/month/year/customize. Selecting the same date again still calls onSelect. To react specifically to the day cell, check info.source=date rather than any header change.

value does not support bind:value. Save Dayjs via callback; the component does not normalize its time, milliseconds, or time zone. Another date type is connected through the public generateCalendar and CalendarGenerateConfig, rather than by passing an arbitrary Date to a standard Calendar.

Events and own header

cellRender - Svelte snippet with date and info.type=date/month. It complements the standard content. Events on the calendar show Badge for the day and total for the month; events for several days construct stripes based on the example data.

fullCellRender replaces the entire internal contents of the cell. info.originNode contains a snippet of the original internal markup that you can save in your composition. For the week number column, render-snippets are not called. Does

headerRender gets value, type, onChange and onTypeChange. For your own header, call these handlers to save the selection and mode switching. onChange of the header reports source=customize; onTypeChange changes the panel mode without a separate date picker. Example of a header uses public Svelte components for switches.

Restrictions, language and design

validRange compares boundaries inclusive of timestamp precision. For entire calendar days, specify startOf('day') and endOf('day') as in the constraint example. disabledDate identifies unavailable cells; don't modify the passed date object inside the predicate.

ConfigProvider with ruRU/enUS specifies a dictionary, locale.lang specifies a separate calendar. For another language, also load the Day.js locale and match it with the component's date and settings. Locale settings determine the start of the week; global dayjs.locale is not enough to translate all controls.

Lunar calendar receives signature via Intl. This is an adaptation of the display without the solar seasons and holiday guide. The presence of the necessary hieroglyphs depends on the page font; the selected date type remains Dayjs.

classNames/styles accept an object or function from props; styles contains CSS strings. With fullCellRender and headerRender the content belongs to your snippet. Semantic styles shows valid slots and ConfigProvider.calendar. The theme.components.Calendar component design tokens apply to the calendar, its header, and its cells.

Calendar CSS prefixes show the global ConfigProvider.prefixCls and the local prefixCls. The local value is the full base Picker prefix: the calendar root adds -calendar, and the cells and originNode use it directly. cellRender/fullCellRender get this name in info.prefixCls. An empty string/undefined returns the common provider prefix with -picker. Select and Radio headers inherit the common namespace regardless of the local Calendar.prefixCls; theme.cssVar.prefix sets theme variables separately. Changing the prefix preserves the root, date with original time, focus, and open header list.

Cells retain the keyboard navigation of the standard panel. bind:nativeElement returns the root div after mount and is cleared when unmounted; Calendar does not have exported focus/blur.

Examples

SuMoTuWeThFrSa
27
28
29
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

Basic calendar

Complete calendar with transition between year and month. defaultValue specifies the starting day.

SuMoTuWeThFrSa
27
28
29
30
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
  • Success Release
16
17
18
19
20
  • Warning Check
  • Processing Assembly
21
22
23
24
25
26
27
28
29
30
31
01
02
03
04
05
06
07

Calendar events

cellRender supplements days with a list of events, and months with their number. Svelte snippet is used for cell contents.

SuMoTuWeThFrSa
27
28
29
30
01
02
03
04
05
06
07
08
09
10
11
12
Checking layouts
13
14
Development
15
16
17
18
19
20
Release
21
22
23
24
25
26
27
28
29
30
31
01
02
03
04
05
06
07
Checking layouts: 2026-10-12 — 2026-10-15Development: 2026-10-14 — 2026-10-18Release: 2026-10-20 — 2026-10-20

Events for several days

cellRender draws start, middle, end and one-day event bars. Ranges refer to example data; the Calendar value remains a single date.

SuMoTuWeThFrSa
27
28
29
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

Calendar in card

fullscreen=false includes a mini-calendar. The container is limited to a width of 320 px and shrinks along with the page.

Selected day: 2026-10-15
SuMoTuWeThFrSa
27
28
29
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
2026-10-15; source: —

Guided selection

value is updated via onChange, onSelect reports the source and reselect. The selected day is displayed next to it.

SuMoTuWeThFrSa
27
八月17日
28
八月18日
29
八月19日
30
八月20日
1
八月21日
2
八月22日
3
八月23日
4
八月24日
5
八月25日
6
八月26日
7
八月27日
8
八月28日
9
八月29日
10
九月1日
11
九月2日
12
九月3日
13
九月4日
14
九月5日
15
九月6日
16
九月7日
17
九月8日
18
九月9日
19
九月10日
20
九月11日
21
九月12日
22
九月13日
23
九月14日
24
九月15日
25
九月16日
26
九月17日
27
九月18日
28
九月19日
29
九月20日
30
九月21日
31
九月22日
1
九月23日
2
九月24日
3
九月25日
4
九月26日
5
九月27日
6
九月28日
7
九月29日

Lunar date via Intl

fullCellRender shows Chinese lunar date via built-in Intl. The solar seasons from the original example are not calculated here.

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

Week numbers

showWeek adds week numbers. Selecting a number publishes the beginning of the calendar line.

SuMoTuWeThFrSa
27
28
29
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
2026-10-15; mode: month; source: —

Own hat

headerRender gets value, mode and callbacks. Public Select/RadioGroup controls year, month and mode.

SuMoTuWeThFrSa
27
28
29
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

Semantic styles

The classes object and styles function are applied to real slots; the function receives props Calendar.

SuMoTuWeThFrSa
27
28
29
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
2026-10-15

Valid working dates

validRange limits exact timestamps to inclusive; the borders are extended for whole days. disabledDate excludes weekends.

SuMoTuWeThFrSa
27
28
29
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
29.10.2026

Interactive calendar from review

Saved example: switching the full view, week numbers and controlled date.

SuMoTuWeThFrSa
27
28
29
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
2026-10-15 12:34:56.789 Changes: 0
SuMoTuWeThFrSa
27
28
29
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
Picker: project-picker; root: project-picker-calendar Waiting mount

PrefixCls specifies the base name of Picker; Calendar appends -calendar to the root. CellRender and fullCellRender receive the same prefix via info.prefixCls, originNode uses it for its classes. Select and Radio headers separately inherit the common namespace. Both calendars use the same local class in different theme areas; the date is stored as Dayjs with the original time.

Calendar CSS prefixes

General and local Picker prefix, independent Select/Radio headers, renderers and adjacent calendar. The date with milliseconds is saved when changing names.

Coverage Examples

Nine themes of ant.design 6.7 live page collated. Cards are arranged in one column: events and range bars require space in width.

Themes of official Calendar examples
ThemeConditionExample Svelte
BasicImplementedBasic calendar
Notice CalendarImplemented via cellRenderCalendar events
Event RangeImplemented via cellRenderEvents for several days
CardImplementedCalendar in card
Selectable CalendarImplementedGuided selection
Lunar CalendarPartial: lunar date via Intl, without solar seasonsLunar date via Intl
Show WeekImplementedWeek numbers
Customize HeaderImplemented via Svelte snippetOwn hat
Custom semantic dom stylingImplementedSemantic styles

Lunar example adapted via Intl: Chinese lunar date is shown, without solar seasons and holiday guide. This is display data; the model remains Dayjs.

API

The main parameters are checked against the public CalendarProps. Regular Calendar works with Dayjs. For its date type, generateCalendar is exported with the CalendarGenerateConfig adapter.

Main parameters of Calendar
PropertyDescriptionTypeDefault
prefixClsFull base Picker prefix; the root Calendar adds -calendar. The empty string/undefined inherit ConfigProvider. Cells, originNode and info.prefixCls follow this name; Select/Radio headers use an independent common prefix. The namespace of the topic is set separately.stringConfigProvider.prefixCls + "-picker"
valueControlled date via onChange. Without bind:value; time and timezone are not normalized.Dayjsundefined
defaultValueStart date of the local state.DayjsCurrent date
modeControlled mode. Update it in onPanelChange to enable switching.month | yearmonth
fullscreenfalse includes a mini-calendar and small header controls.booleantrue
showWeekWeek column in month mode. Selecting a number publishes the beginning of the line.booleanfalse
validRangeInclusive boundaries with timestamp precision; They also limit the cap. For full days use startOf/endOf.[Dayjs, Dayjs]undefined
disabledDateLimits panel cells. A month is disabled if its first and last days are disabled.(date: Dayjs) => booleanundefined
onChangeChange calendar day; reselecting the same day does not call onChange.(date: Dayjs) => void—
onPanelChangePanel transition or mode change. In controlled mode, adopt new mode outside.(date, mode: CalendarMode) => void—
onSelectEvery choice, including repeated ones. source=date/month/year/customize reports the source.(date, info: CalendarSelectInfo) => void—
localeLang is combined with a common locale and base vocabulary.CalendarLocaleFrom ConfigProvider
headerRenderGets value, type, onChange and onTypeChange. The onChange call has source=customize.Snippet<[CalendarHeaderRenderInfo]>Standard hat
cellRenderAdds content to a standard cell. info.type=date/month, prefixCls — allowed Picker prefix; originNode - internal markup snippet with this prefix.Snippet<[Dayjs, CalendarCellRenderInfo]>Empty addition
fullCellRenderReplaces the contents of a cell. Not called for week numbers.Snippet<[Dayjs, CalendarCellRenderInfo]>Standard cell
classNamesClasses root/header/body/content/item/itemContent, object or function with props.CalendarSemanticundefined
stylesCSS lines of the same slots. Local styles come after the provider configuration.CalendarSemanticundefined
nativeElementbind:nativeElement gives root after mount and clears ref when unmount.HTMLDivElementundefined

cellRender completes the contents of the cell, and fullCellRender replaces it. Both parameters accept Svelte snippets.

Events and ref

onChange reports the day change. onSelect is also called when selecting again; info.source distinguishes between date, month, year and customize. onPanelChange reports a change of panel or mode.

In managed mode, store the new value in onChange and the new mode in onPanelChange. headerRender.onChange selects date with source=customize; onTypeChange switches the mode via onPanelChange.

Calendar does not have exported focus()/blur(). bind:nativeElement gives root div after mount and clears ref when unmount; This is the Svelte equivalent of CalendarRef.nativeElement.

Semantic DOM

The table has the role grid, days and months - gridcell. The selected date is marked aria-selected, the disabled date is aria-disabled, the current date is aria-current=date. Arrows move focus, Home/End move to line boundaries, Enter/Space select a cell.

The highlight below refers to real slots. In RTL, horizontal arrows take into account the direction of the interface.

SuMoTuWeThFrSa
27
28
29
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
item: Day or month cell; Week numbers are excluded.
Real slots Calendar
SlotPurpose
rootRoot div Calendar.
headerStandard hat with choice of year, month and mode.
bodyTable container.
contentTable with the grid role.
itemDay or month cell; Week numbers are excluded.
itemContentAdditional contents of a standard cell; with fullCellRender this wrapper is replaced.

styles accepts CSS strings, classNames — classes; both forms support callback with props. With custom headerRender, the header is created by your snippet, with fullCellRender you control the internal contents of the cell.

Registration tokens

The six component tokens correspond to the official table and the public ComponentTokenMap.Calendar. theme.components.Calendar applies tokens to the calendar. Semantic styles and ConfigProvider.calendar clarify the design.

Calendar Component Tokens
TokenPurpose
fullBgFull calendar background.
fullPanelBgPanel background.
itemActiveBgSelected day.
miniContentHeightMini calendar height.
monthControlWidthMonth selection width.
yearControlWidthYear selection width.

Common tokens of the current topic

Names are checked against the ant.design table; the values ​​are read reactively via theme.useToken().

Common tokens of the current topic
TokenMeaning
colorBgContainer#ffffff
colorFillSecondaryrgba(0,0,0,0.06)
colorIconrgba(0,0,0,0.45)
colorIconHoverrgba(0,0,0,0.88)
colorPrimary#2f54eb
colorSplitrgba(5,5,5,0.06)
colorTextrgba(0,0,0,0.88)
colorTextDisabledrgba(0,0,0,0.25)
colorTextHeadingrgba(0,0,0,0.88)
colorTextLightSolid#fff
colorTextTertiaryrgba(0,0,0,0.45)
borderRadiusLG8
borderRadiusSM4
controlHeightLG40
controlHeightSM24
controlItemBgActive#f0f5ff
controlItemBgHoverrgba(0,0,0,0.04)
fontFamily-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'
fontSize14
fontWeightStrong600
lineHeight1.5714285714285714
lineTypesolid
lineWidth1
lineWidthBold2
marginXS8
marginXXS4
motionDurationMid0.2s
motionDurationSlow0.3s
padding16
paddingSM12
paddingXS8
paddingXXS4
screenXS480

ConfigProvider.calendar

class, style, classNames and styles are supported. Local semantic styles come after the context; style of the root has final precedence. The nested calendar object replaces the entire parent object.

SuMoTuWeThFrSa
27
28
29
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
<script lang="ts">
  import dayjs from 'dayjs';
  import { Calendar, ConfigProvider } from '@woodger/antd';
</script>

<ConfigProvider calendar={{
  styles: {
    root: `
      border: 2px solid #722ed1;
      border-radius: 8px;
    `,
    header: 'padding-inline:12px'
  }
}}>
  <Calendar fullscreen={false} defaultValue={dayjs('2026-10-15')} />
</ConfigProvider>

FAQ

How to get the date specifically from a cell?

Use onSelect with info.source=date. onChange is also called on changes from the header, and reselecting the day can only be reported by onSelect.

How to set the language and start of the week?

Match locale or ConfigProvider.locale with Day.js locale. The first day of the week is determined by the corresponding language settings.

cellRender replaces all day?

It complements the cell. To replace internal content, use fullCellRender; The original markup is available via info.originNode.

Why does validRange use startOf/endOf?

Boundaries are compared as timestamps, without automatic time discarding. Expand them explicitly if full days are needed.

Events for several days change the value type?

No, value remains one date. The stripes are built by the example from the application's own data.

Is it possible to use another date library?

generateCalendar accepts the CalendarGenerateConfig adapter and creates a component for your date type. Standard Calendar uses Dayjs.