DayFlowSTUDIO

Svelte calendar component

Open-Source Svelte Event Calendar

DayFlow is an MIT-licensed calendar component for Svelte 5. The useCalendarApp helper takes views, plugins and events as one object, and the component receives it with Svelte's shorthand prop syntax. Svelte has far fewer calendar options than React or Vue, so this is often the part of a cross-framework product that was going to be built by hand.

Try the interactive demoInstallation guide
Package
@dayflow/svelte
Requires
Svelte 5
Licence
MIT
Views
Day, week, month, year, agenda

Add DayFlow to a Svelte app

Install the Svelte adapter, the calendar core and the drag plugin.

npm install @dayflow/svelte @dayflow/core @dayflow/plugin-drag

The stylesheet is not optional — without @dayflow/core/dist/styles.css the grid renders unstyled. If your app uses Tailwind, import @dayflow/core/dist/styles.components.css instead, which leaves out the CSS reset that would otherwise fight Tailwind's preflight.

This component opens on today with one event you can drag or resize in the time grid.

<script>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/svelte';
import {
  createDayView,
  createWeekView,
  createMonthView,
  createEventsPlugin,
  createEvent,
} from '@dayflow/core';
import { createDragPlugin } from '@dayflow/plugin-drag';
import '@dayflow/core/dist/styles.css';

const calendar = useCalendarApp({
  views: [createDayView(), createWeekView(), createMonthView()],
  plugins: [createDragPlugin(), createEventsPlugin()],
  events: [
    createEvent({
      id: 'team-meeting',
      title: 'Team meeting',
      start: new Date(2026, 0, 14, 10, 0),
      end: new Date(2026, 0, 14, 11, 0),
    }),
  ],
  initialDate: new Date(),
});
</script>

<DayFlowCalendar {calendar} />

What is specific to Svelte

Svelte 5 only

The adapter declares svelte as a peer dependency at ^5.0.0, so it needs Svelte 5. That is the one hard version constraint among the four adapters — React accepts 18 and up, Vue 3 and up, Angular 14 and up.

Shorthand prop, single object

<DayFlowCalendar {calendar} /> is the whole template. There are no separate event or view props, so state flows through that one instance and you read and write events through the plugin API rather than by reassigning props.

Rendering in SvelteKit

The time grid is laid out from the container's measured size, so render the calendar in the browser rather than during SSR — guard it with browser from $app/environment, or mount it in onMount. The stylesheet import can stay in your root layout.

Plan the day or scan the whole year

Register only the views you need. The day view suits appointments, the week view a team's schedule, the month view a workload at a glance, and the two year views a whole planning horizon. The same events stay in place as users switch layouts.

Create and adjust events in the grid

Drag across the grid to create an event, move it to reschedule, or resize it to change its duration. The drag plugin reports every change, so your own scheduling rules decide what is allowed before anything is saved.

Add only what you use

Behaviour arrives as plugins rather than configuration flags, so nothing you skip ends up in the bundle.

Coming from another Svelte calendar

There is not much to port from in Svelte, which is usually the reason teams end up here: the realistic alternatives are wrapping a framework-agnostic library yourself or building the grid from scratch. If the calendar in your product also exists in a React or Vue codebase, the configuration object is the same in all four adapters, so the two implementations stay in step instead of drifting. If you are replacing FullCalendar somewhere in the same product, the FullCalendar comparison maps the options.

When dates are not the main axis

If your users ask “who is assigned, and when?” rather than “what is happening on this date?”, a calendar is the wrong primitive:

Svelte calendar questions

Is the Svelte calendar free to use?

Yes. @dayflow/svelte, @dayflow/core and the plugins used on this page are MIT licensed, including the day, week, month, year and agenda views. Resource timelines, resource grids, appointment booking and print output are separate paid modules.

Which Svelte versions are supported?

Svelte 5. The adapter declares svelte as a peer dependency at ^5.0.0, so earlier versions are not supported.

Does it work with SvelteKit?

Yes, as a client-rendered component. The calendar lays out its time grid from the measured container size, so guard it with browser from $app/environment or mount it in onMount rather than rendering it during SSR.

Do I need a date library?

No. DayFlow has no date-library peer dependency. You pass JavaScript Date objects to createEvent, and locale-specific formatting comes from the localization plugin.

How do I control the calendar height?

The calendar fills the width of its container and takes its height from the --df-calendar-height custom property on .df-calendar-container. Set it to a fixed value, a viewport unit, or anything else CSS accepts. The theme customization guide covers the rest of the token surface.

Next steps