npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@digitalcrafted/vue-scheduler

v0.2.2

Published

A Vue 3 scheduler component with day/week/month/year views for displaying calendar events

Readme

vue-scheduler

A Vue 3 scheduler component with day/week/month/year views for displaying calendar events.

Features

  • 📅 Multiple view modes: Day, Week, Month, and Year
  • 🎨 Customizable event colors
  • ⚡ Support for static events array or dynamic event loading
  • 🌍 Internationalization support with dayjs
  • 📱 Responsive design with Tailwind CSS
  • 🎯 TypeScript support

Installation

npm install @digitalcrafted/vue-scheduler

Usage

Basic Example

<template>
  <Scheduler :events="events" />
</template>

<script setup>
import { Scheduler } from "@digitalcrafted/vue-scheduler";
import "@digitalcrafted/vue-scheduler/dist/style.css";

const events = [
  {
    label: "Meeting",
    start: "2024-10-08 10:00",
    end: "2024-10-08 11:00",
    bgColor: "#3498db",
  },
  {
    label: "Conference",
    start: "2024-10-09 14:00",
    end: "2024-10-09 18:00",
    bgColor: "#9575cd",
  },
];
</script>

With Dynamic Event Loading

<template>
  <Scheduler :events="loadEvents" initial-date="2024-10-08" view-mode="week" />
</template>

<script setup>
import { Scheduler } from "@digitalcrafted/vue-scheduler";

const loadEvents = ({ dateRange, setEvents }) => {
  // Fetch events from API
  fetch(`/api/events?start=${dateRange.start}&end=${dateRange.end}`)
    .then((res) => res.json())
    .then((data) => setEvents(data));
};
</script>

Hiding View Mode Selector

<template>
  <Scheduler
    :events="events"
    view-mode="month"
    :hide-view-mode-selector="true"
  />
</template>

<script setup>
import { Scheduler } from "@digitalcrafted/vue-scheduler";
import "@digitalcrafted/vue-scheduler/dist/style.css";

const events = [
  {
    label: "Meeting",
    start: "2024-10-08 10:00",
    end: "2024-10-08 11:00",
    bgColor: "#3498db",
  },
];
</script>

Props

events

  • Type: SchedulerEvent[] | Function
  • Required: Yes
  • Description: Array of events or a function for dynamic loading

Event object structure:

interface SchedulerEvent {
  label: string; // Event label/name
  start: string | Date | number; // Start date/time
  end?: string | Date | number; // End date/time (optional)
  bgColor?: string; // Background color (hex code)
  id?: string | number; // Unique identifier (optional)
}

Dynamic loading function signature:

function loadEvents({
  dateRange: { start: Date, end: Date },
  setEvents: (events: SchedulerEvent[]) => void
}): void

initialDate

  • Type: string | Date | number
  • Default: Current date
  • Description: Initial date to display

viewMode

  • Type: 'day' | 'week' | 'month' | 'year'
  • Default: 'week'
  • Description: Initial view mode

dateLocale

  • Type: string
  • Default: undefined
  • Description: Locale for date formatting (e.g., 'en', 'fr', 'de')

translations

  • Type: Record<string, string>
  • Default: {}
  • Description: Translation object for custom labels

Available translation keys:

  • header.today: Label for "Today" button

hideViewModeSelector

  • Type: boolean
  • Default: false
  • Description: Hides the view mode selector (day/week/month/year toggle) from the header when set to true

Event Format

Events support both all-day and timed events:

// All-day event (no time specified)
{
  label: "Holiday",
  start: "2024-10-08",
  bgColor: "#ff9800"
}

// Timed event
{
  label: "Meeting",
  start: "2024-10-08 10:00",
  end: "2024-10-08 11:00",
  bgColor: "#3498db"
}

// Multi-day event
{
  label: "Conference",
  start: "2024-10-08 09:00",
  end: "2024-10-10 18:00",
  bgColor: "#9575cd"
}

Styling

The component uses Tailwind CSS for styling. Make sure Tailwind is available in your project, or import the default styles:

import "@digitalcrafted/vue-scheduler/dist/style.css";

You can customize the appearance by overriding Tailwind classes or using CSS variables.

TypeScript

TypeScript definitions are included:

import type {
  SchedulerEvent,
  SchedulerProps,
} from "@digitalcrafted/vue-scheduler";

Author

Francis Onwumere

License

MIT