Skip to content

motion

How the calendar moves between periods, and as events come, go and drop.

TypeMotionAdapter
Defaultthe built-in motion (Web Animations, reduced when the system asks)
Live update (update())Yes
Declared inpackages/dom/src/calendar.ts

By default the calendar moves with the Web Animations API, briefly, and not at all when the system asks for reduced motion. An adapter of yours replaces it: createGsapMotion({ preset: 'sober' | 'expressive' }) from @dzcalendar/motion-gsap (GSAP, optional, never a dependency of the calendar) gives a richer motion, still behind prefers-reduced-motion. The calendar owns the adapter it is given: it is destroyed with the calendar, or when replaced by update({ motion }) — so one adapter is never given to two calendars alive at once: the factories make one per calendar.

import { createCalendar } from '@dzcalendar/dom';
import { createGsapMotion } from '@dzcalendar/motion-gsap';
createCalendar(element, { timeZone: 'Europe/Paris', motion: createGsapMotion({ preset: 'expressive' }) });

In Angular, provideDzMotion(() => adapter) makes one per calendar (or [options]); in React and Vue it is a prop (motion), made once at creation (DzCalendarProvider’s or the plugin’s motion makes one per calendar).