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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@widgetkit/scheduler-js

v0.0.2

Published

Vanilla JavaScript timeline scheduler component

Readme

@widgetkit/scheduler-js

A vanilla JavaScript timeline scheduler. No framework required — works in any HTML page, React, Vue, Angular, or plain JS project.

Documentation & live demo →

Installation

npm install @widgetkit/scheduler-js
# or
pnpm add @widgetkit/scheduler-js
# or
yarn add @widgetkit/scheduler-js

Usage

<div id="scheduler" style="height: 400px"></div>
import { createScheduler } from '@widgetkit/scheduler-js';
import '@widgetkit/scheduler-js/styles.css';

const scheduler = createScheduler(document.getElementById('scheduler'), {
  resources: [
    { id: 'r1', name: 'Alice' },
    { id: 'r2', name: 'Bob' },
  ],
  items: [
    {
      id: '1',
      resourceId: 'r1',
      name: 'Team standup',
      color: '#6366f1',
      start: new Date('2025-06-10T09:00'),
      end:   new Date('2025-06-10T09:30'),
    },
  ],
  date: new Date('2025-06-10'),
  showNav: true,
  onItemClick: ({ item }) => console.log(item),
  onItemsChange: (items) => console.log(items),
});

// Update options at any time
scheduler.setOptions({ items: updatedItems });

// Clean up
scheduler.destroy();

API

createScheduler(container, options)

Mounts the scheduler into container and returns a SchedulerInstance.

const scheduler = createScheduler(element, options);

scheduler.setOptions(partial)

Update one or more options without remounting.

scheduler.setOptions({ items: newItems, zoom: 2 });

scheduler.destroy()

Removes the scheduler from the DOM and cleans up all event listeners and timers.


Options

Data

| Option | Type | Required | Description | | ----------- | ----------------- | -------- | ---------------------------- | | resources | Resource[] | Yes | Rows in the timeline. | | items | TimelineItem[] | Yes | Events to display. | | date | Date | Yes | The day currently displayed. |

Time range

| Option | Type | Default | Description | | ------------ | -------- | ------- | --------------------------------- | | startHour | number | 0 | First hour shown on the timeline. | | endHour | number | 24 | Last hour shown on the timeline. | | snapMinutes| number | 15 | Drag/resize snap interval. |

Interaction

| Option | Type | Default | Description | | -------------------- | --------- | ------- | ---------------------------------------------- | | draggable | boolean | true | Allow items to be dragged. | | resizable | boolean | false | Show resize handles on items. | | creatable | boolean | false | Hold on empty space to create a new item. | | editable | boolean | true | Show edit option in context menu. | | readonly | boolean | false | Disables all interaction (drag, resize, create, edit, keyboard). Tooltips and hover events still work. | | minDurationMinutes | number | 0 | Minimum item duration when resizing. | | maxDurationMinutes | number | 0 | Maximum item duration (0 = unlimited). |

Display

| Option | Type | Default | Description | | ---------------- | ------------- | ------- | ---------------------------------------- | | showNav | boolean | false | Show date navigation and zoom controls. | | showDateNav | boolean | true | Show prev/next/date buttons in nav bar. | | showZoomControls| boolean | true | Show 1x/2x/4x zoom buttons in nav bar. | | zoom | 1 \| 2 \| 4 | 1 | Horizontal zoom level. | | showTime | boolean | true | Show start/end time on each item. | | showAvatar | boolean | true | Show avatar/initials for each resource. | | showEventCount | boolean | true | Show event count below resource name. | | showTooltip | boolean | true | Show tooltip on item hover. | | showNowLine | boolean | true | Show red line at current time. |

Callbacks

| Option | Signature | Description | | -------------------- | ------------------------------------------------ | ------------------------------------ | | onItemsChange | (items: TimelineItem[]) => void | Items were moved, resized, or edited.| | onDateChange | (date: Date) => void | User navigated to a different date. | | onZoomChange | (zoom: 1 \| 2 \| 4) => void | Zoom level changed. | | onItemCreate | (detail: ItemCreateDetail) => void | New item created via hold-to-create. | | onItemClick | (detail: ItemClickDetail) => void | Item was clicked. | | onItemDblClick | (detail: ItemDblClickDetail) => void | Item was double-clicked. | | onItemHover | (detail: ItemHoverDetail) => void | Pointer entered or left an item. | | onItemContextMenu | (detail: ItemContextMenuDetail) => void | Item was right-clicked. | | onItemDragStart | (detail: ItemDragStartDetail) => void | Drag started. | | onItemDragEnd | (detail: ItemDragEndDetail) => void | Drag committed. | | onItemResizeStart | (detail: ItemResizeStartDetail) => void | Resize started. | | onItemResizeEnd | (detail: ItemResizeEndDetail) => void | Resize committed. |


Types

interface Resource {
  id: string;
  name: string;
  avatar?: string;
}

interface TimelineItem {
  id: string;
  resourceId: string;
  name: string;
  color: string;
  start: Date;
  end: Date;
  description?: string;
}

Theming

Override CSS variables on .tl-root:

.tl-root {
  --tl-bg: #ffffff;
  --tl-header-bg: #f8fafc;
  --tl-text-color: #1e293b;
  --tl-grid-line-color: #e2e8f0;
  --tl-time-label-color: #94a3b8;
  --tl-resource-col-width: 160px;
  --tl-resource-border-color: #e2e8f0;
  --tl-item-radius: 4px;
  --tl-item-text-color: #ffffff;
  --tl-item-opacity-dragging: 0.4;
  --tl-now-line-color: #ef4444;
  --tl-create-ghost-color: #3b82f6;
  --tl-tooltip-bg: #1e293b;
  --tl-tooltip-color: #ffffff;
  --tl-focus-color: #3b82f6;
  --tl-font-family: sans-serif;
}