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-timetable-events

v3.0.0

Published

Timetable events React component

Readme

react-timetable-events

NPM JavaScript Style Guide

Description (Demo)

React Timetable Events - flexible timetable component with overlapping event support. Ideal for school timetables, scheduling apps, and calendar views.

Installation

# with yarn
yarn add react-timetable-events

# with npm
npm install react-timetable-events

Usage

import * as React from 'react'
import Timetable from 'react-timetable-events'

export const Example = () => (
  <Timetable 
    events={{
      monday: [
        {
          id: 1,
          name: "Custom Event 1",
          type: "custom",
          startTime: new Date("2018-02-23T11:30:00"),
          endTime: new Date("2018-02-23T13:30:00"),
        },
      ],
      tuesday: [],
      wednesday: [],
      thursday: [],
      friday: [],
    }}
    style={{ height: '500px' }}
  />
)

Available props

interface TimetableProps {
  events: TimetableEvents;                          // events object organized by day
  hoursInterval?: { from: number; to: number };  // displayed hours range (default: 8-17)
  renderDayHeader?: React.ComponentType<DayHeaderProps>;   // custom day header component
  renderHour?: React.ComponentType<HourProps>;             // custom hour cell component
  renderEvent?: React.ComponentType<EventPreviewProps>;    // custom event component
  getDayLabel?: (day: string) => string;   // customize weekday labels
  timeLabel?: string;                      // Time column header text
  style?: React.CSSProperties;             // wrapper styles (height, width, etc.)
  headerAttributes?: Record<string, string>;  // HTML attributes for header
  bodyAttributes?: Record<string, string>;    // HTML attributes for body
  hourColumnWidth?: number;                // width of the hour column in px (default: 70)
}

Check Storybook for more details about customization.

Events - the only required prop

export interface TimetableEvent {
  id: number | string;
  name: string;
  startTime: Date;
  endTime: Date;
  type?: string;
  [key: string]: unknown;
}

export interface TimetableEvents {
  [day: string]: TimetableEvent[];
}

const events: TimetableEvents = {
  monday: [
    {
      id: 1,
      name: "Custom Event 1",
      type: "custom",
      startTime: new Date("2018-02-23T11:30:00"),
      endTime: new Date("2018-02-23T13:30:00"),
    },
  ],
  tuesday: [
    {
      id: 2,
      name: "Custom Event 2",
      type: "custom",
      startTime: new Date("2018-02-22T12:30:00"),
      endTime: new Date("2018-02-22T14:30:00"),
    },
    {
      id: 3,
      name: "Custom Event 3",
      type: "custom",
      startTime: new Date("2018-02-22T16:30:00"),
      endTime: new Date("2018-02-22T18:45:00"),
    },
  ],
  wednesday: [],
  thursday: [],
  friday: [],
};

Features

  • Overlapping event detection - Events that overlap in time are automatically displayed side-by-side in columns
  • Hours interval clipping - Events are clamped to the visible hours range
  • Accessible markup - ARIA roles and labels for screen readers
  • Fully customizable - Override default rendering for day headers, hours, and events
  • Responsive - Automatically adjusts to container size changes
  • TypeScript support - Full type definitions included

License

MIT © Nikola Spalevic & Filip Furtula