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

react-generic-calendar

v1.0.7

Published

A generic, customizable React calendar component with day, week, and month views, multi-select, and event filtering

Readme

React Generic Calendar

npm version License: MIT TypeScript React

A complete and generic React calendar component with automatic time grid generation.

React Generic Calendar Demo

🎯 Smart Grid: Only shows time slots where events exist - no empty rows! 📅 Week View: Full 7-day week display by default 🏋️ Fitness Ready: Built-in fields for gyms, classes, and bookings

✨ Features

  • 🗓️ Dynamic Grid: Time slots automatically generated based on registered events
  • 📅 3 Views: Day, Week, and Month
  • 🎨 Fully Customizable: Themes, colors, custom styles
  • 🏋️ Fitness Ready: Specific fields (instructor, capacity, level)
  • 📱 Responsive: Works on desktop, tablet, and mobile
  • 🌍 i18n: Multi-language support
  • Performance: Optimized for large event volumes
  • 🔧 TypeScript: Complete typing included
  • 📦 Lightweight: Few dependencies (React and date-fns)

🚀 Installation

npm install react-generic-calendar

🎯 Dynamic Grid Technology

Smart Time Slots: Only displays time slots where events actually exist Performance Optimized: No empty rows = faster rendering Flexible Hours: Works with any time format (06:30, 14:45, 23:15, etc.)

📸 Visual Features

The screenshot above demonstrates:

Dynamic Grid: Only 5 time rows displayed (06:00, 07:30, 18:00, 20:30) - no empty 08:00, 09:00, 10:00, etc. ✅ Multiple Events: Several appointments can occur simultaneously in the same time slot ✅ Color Coding: Different event types with distinct colors (meetings, projects, consultations, etc.) ✅ Complete Information: Shows participant count, responsible person, and event type ✅ Professional Layout: Clean, modern design suitable for any scheduling application

📖 Basic Usage

The component displays a full week (7 days) by default with dynamic grid based on events:

import React from "react";
import { GenericCalendar } from "react-generic-calendar";

function App() {
  const events = [
    {
      id: "1",
      title: "Meeting",
      day: "2025-01-14",
      hour: "09:00",
      hourEnd: "10:00"
    },
    {
      id: "2",
      title: "Presentation",
      day: "2025-01-14",
      hour: "14:30",
      hourEnd: "15:30"
    }
  ];

  return (
    <GenericCalendar
      events={events}
      // Default: view="week" (7 days)
      // Grid: only shows 09:00 and 14:30 time slots
    />
  );
}

🏋️ Fitness Example

import React from "react";
import { GenericCalendar } from "react-generic-calendar";

function GymSchedule() {
  const gymEvents = [
    {
      id: "pilates-1",
      title: "Pilates",
      day: "2025-01-14",
      hour: "08:00",
      hourEnd: "09:00",
      instructor: "Priscila Brito",
      capacity: "5/20",
      level: "beginner",
      color: "#ed8936"
    }
  ];

  return (
    <GenericCalendar
      events={gymEvents}
      callbacks={{
        onEventClick: (event) => {
          console.log("Class selected:", {
            title: event.title,
            instructor: event.instructor,
            capacity: event.capacity
          });
        }
      }}
    />
  );
}

📋 Event Properties

| Property | Type | Required | Description | | ------------ | -------- | -------- | ----------------------------------------------------- | | id | string | ✅ | Unique identifier | | title | string | ✅ | Event title | | day | string | ✅ | Date in 'YYYY-MM-DD' format | | hour | string | ✅ | Start time 'HH:mm' | | hourEnd | string | ❌ | End time 'HH:mm' | | color | string | ❌ | Event color (hex) | | instructor | string | ❌ | Instructor name | | capacity | string | ❌ | Capacity in '5/20' format | | level | string | ❌ | Level: 'beginner', 'intermediate', 'advanced' | | status | string | ❌ | Status: 'available', 'full', 'cancelled', 'confirmed' | | equipment | string[] | ❌ | Equipment list | | price | number | ❌ | Class price | | location | string | ❌ | Event location |

⚙️ Configuration

<GenericCalendar
  events={events}
  initialViewMode="week"
  theme={{
    primaryColor: "#667eea",
    backgroundColor: "#ffffff",
    textColor: "#2d3748"
  }}
  callbacks={{
    onEventClick: (event) => console.log(event),
    onEventEdit: (event) => console.log("Edit:", event),
    onEventDelete: (id) => console.log("Delete:", id)
  }}
/>

🎨 Key Visual Features

| Feature | Traditional Calendar | React Generic Calendar | | ------------------ | ----------------------------- | --------------------------------- | | Empty Rows | ❌ Shows all 24 hours | ✅ Only event hours | | Performance | ❌ Renders 168 cells/week | ✅ Renders only needed cells | | Visual Clarity | ❌ Cluttered with empty space | ✅ Clean, focused view | | Flexibility | ❌ Fixed hourly intervals | ✅ Any time format (06:30, 14:45) | | Responsiveness | ❌ Heavy DOM | ✅ Lightweight, fast |

🚀 Perfect For

  • 🏋️ Gyms & Fitness Centers - Class schedules with instructors and capacity
  • 🏥 Medical Clinics - Doctor appointments with rooms and specialties
  • 📚 Educational Institutions - Course schedules with teachers and rooms
  • 🏢 Corporate - Meeting rooms and conference bookings
  • 🎯 Any Business - With time-based appointments or events

📄 License

MIT License