百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

svelte-fullcalendar

> 前端框架
开源

一个围绕 FullCalendar 的 Svelte 组件包装器

199 stars0 点赞5 次浏览
访问官网GitHub

工具介绍

一个围绕 FullCalendar 的 Svelte 组件包装器

looking for a new mainteiner...

interested? ping me

svelte-fullcalendar

A Svelte 3 component-wrapper for FullCalendar.

Please @mention me for any issue (I'm unwatching for renovate reasons)

FullCalendar (almost) seamlessly integrates with the Svelte JavaScript compiler and the SvelteKit JavaScript framework. This wrapper provides a component that matches the functionality of FullCalendar's standard API.

Setup

First install the wrapper and related dependencies:

bash
npm install --save-dev svelte-fullcalendar
npm install --save-dev @fullcalendar/core

Then install any additional FullCalendar plugins you plan to use:

bash
npm install --save-dev @fullcalendar/daygrid

Usage

You may then begin to write a parent component that leverages the FullCalendar wrapper component, including type definitions if you're using TypeScript:

xml

Note: You must initialize the calendar with at least one plugin which provides a view.

Example

Here you can find a working SvelteKit example.

Props and Emitted Events

For the FullCalendar connector, there is no distinction between props and events. Everything is passed into the master options object as key-value pairs. Here is an example that demonstrates passing in an events array and a dateClick handler:

xml

Modifying Options

You can modify your calendar’s options after initialization by reassigning them within the options object and reassign the options object. This is an example of changing the weekends options:

xml

toggle weekends

Calendar API

Hopefully you won’t need to do it often, but sometimes it’s useful to access the underlying Calendar object for raw data and methods.

This is especially useful for controlling the current date. The initialDate prop will set the initial date of the calendar, but to change it after that, you’ll need to rely on the date navigation methods.

To do something like this, you’ll need to get ahold of the component’s ref (short for “reference”). In the template:

xml

Once you have the ref, you can get the underlying Calendar object via the getApi method:

xml

Scheduler

How do you use FullCalendar Scheduler's premium plugins with Svelte? They are no different than any other plugin. Just follow the same instructions as you did dayGridPlugin in the above example. Also, make sure to include your schedulerLicenseKey:

xml

Until server-side rendering of FullCalendar is fully supported upstream, implementations may decide to share the license key on the client and this is not uncommon. Please note, however, you can still fetch event data and from your own API server-side in order to speed up rendering of your calendar components.

Draggable external events

You'll need to install the interactionPlugin:

bash
npm install --save-dev @fullcalendar/interaction

See the official docs for all available props.

Here is a simple usage example:

xml

  Drag me!

License

This component is released under the MIT license, same as the FullCalendar library.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

vhs

Ben McCann

This project follows the all-contributors specification. Contributions of any kind welcome!

Issues· 4 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptcalendarcomponentfullcalendarjavascript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架