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

react-timelane

v1.2.6

Published

A React/TypeScript library to build timelines / horizontally scrollable calendars with multiple lanes.

Readme

react-timelane

A React/TypeScript library to build timelines / horizontally scrollable calendars with multiple lanes.

Features

react-timelane has a particular focus on usability and comes with many neat features:

  • item drag and drop
  • item resizing
  • jump (scroll) to point in time, lane or item
  • item selection via mouse range

Documentation

Docs and various demos are provided via Storybook: https://dhansmair.github.io/react-timelane

Installation

npm install react-timelane

Code Example

The following code example shows a basic custom Timelane, focusing on the component structure. See docs/src/components/MyTimelane.tsx for the full example:

import { addDays, min } from "date-fns";
import { useState, type MouseEvent } from "react";
import {
  type AvailableSpace,
  type Lane,
  type Item,
  type ItemId,
} from "react-timelane";
import type Allocation from "../models/Allocation";
import type Resource from "../models/Resource";
import AllocationComponent from "./AllocationComponent";

import { Timelane } from "react-timelane";

interface MyTimelaneProps {
  resources: Resource[];
  allocations: Allocation[];
  onAllocationCreate: (allocation: Allocation) => void;
  onAllocationUpdate: (allocation: Allocation) => void;
}

function MyTimelane({
  resources,
  allocations,
  onAllocationCreate,
  onAllocationUpdate,
}: MyTimelaneProps) {
  const [selection, setSelection] = useState<ItemId[]>([]);

  const lanes: Lane[] = resources.map((resource) => ({
    id: resource.id,
    capacity: resource.capacity,
  }));

  const items: Item<Allocation>[] = allocations.map((allocation) => ({
    id: allocation.id,
    laneId: allocation.resourceId,
    start: allocation.start,
    end: allocation.end,
    size: allocation.size,
    offset: allocation.offset,
    payload: allocation,
  }));

  function handleItemUpdate(item: Item<Allocation>) {
    const updatedAllocation: Allocation = {
      ...item.payload,
      resourceId: item.laneId,
      start: item.start,
      end: item.end,
      size: item.size,
      offset: item.offset,
    };

    onAllocationUpdate(updatedAllocation);
  }

  return (
    <Timelane>
      <Timelane.Header
        onDayClick={({ day }) => {
          console.log("day clicked", day);
        }}
        onMonthClick={({ firstDay }) => {
          console.log("month clicked", firstDay);
        }}
        onWeekClick={({ firstDay }) => {
          console.log("week clicked", firstDay);
        }}
      />
      <Timelane.Body
        onSelect={(selection) => {
          setSelection(selection);
        }}
      >
        {lanes.map(({id, capacity}) => (
          <Timelane.Lane
            key={id}
            id={id}
            capacity={capacity}
            items={items.filter((item) => item.laneId === id)}
            onItemUpdate={handleItemUpdate}
            renderItem={(item, isDragged) => (
              <AllocationComponent
                allocation={item.payload}
                isDragged={isDragged}
                isSelected={selection.includes(item.id)}
              />
            )}
          />
        ))}
      </Timelane.Body>
      <Timelane.Background />
      <Timelane.Aside
        lanes={lanes}
        renderLaneHeader={(lane) => <div>{lane.id}</div>}
      />
      <Timelane.Layout.Corner />
    </Timelane.Container>
  );
}