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-gantt-calendar

v0.5.1

Published

A flexible React component for rendering Gantt chart calendars with hierarchical row structures and customizable time ranges.

Readme

react-gantt-calendar

A flexible React component for rendering Gantt chart calendars with hierarchical row structures and customizable time ranges.

Installation

npm install react-gantt-calendar

Usage

import React from 'react'
import { ReactGanttCalendar } from 'react-gantt-calendar'
import 'react-gantt-calendar/dist/style.css'

function App() {
  return (
    <ReactGanttCalendar
      options={{
        displayRange: {
          range: 30,
          unit: 'day',
          unitNumber: 1,
          format: 'MM/DD'
        },
        tableCellWidth: 60,
        startDate: new Date()
      }}
      data={{
        columns: [
          { label: 'Hotel' },
          { label: 'Floor' },
          { label: 'Room' }
        ],
        rows: {
          heads: [
            {
              id: '1',
              label: 'Hotel 1',
              children: [
                {
                  id: '1-1',
                  label: '1F',
                  children: [
                    { id: '1-1-1', label: 'Room 101' },
                    { id: '1-1-2', label: 'Room 102' }
                  ]
                }
              ]
            }
          ],
          contents: [
            {
              headIds: ['1', '1-1', '1-1-1'],
              events: [
                {
                  label: 'Reservation',
                  startAt: new Date('2025-01-15'),
                  endAt: new Date('2025-01-20')
                }
              ]
            }
          ]
        }
      }}
    />
  )
}

Props

Root Props

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | options | Options | No | See below | Display and rendering options | | data | Data | Yes | - | Chart data including columns and rows |

Options Properties

| Property | Type | Required | Default | Description | |----------|------|----------|---------|-------------| | displayRange | DisplayRange | No | See below | Time range display configuration | | displayRange.range | number | No | 30 | Number of time units to display | | displayRange.unit | 'minute' \| 'hour' \| 'day' \| 'week' \| 'month' \| 'year' | No | 'day' | Time unit for display | | displayRange.unitNumber | number | No | 1 | Increment of time units | | displayRange.format | string | No | 'MM/DD' | Date format using dayjs format | | tableCellWidth | number | No | 60 | Width of each time unit column in pixels | | startDate | Date \| string | No | Current date | Calendar start date |

Data Properties

| Property | Type | Required | Default | Description | |----------|------|----------|---------|-------------| | columns | Column[] | Yes | - | Column headers for the row head section | | rows | Rows | Yes | - | Row data structure | | rows.heads | RowHeadProp[] | Yes | - | Hierarchical row header structure | | rows.contents | RowContent[] | Yes | - | Row content with events |

Type Definitions

Options

{
  displayRange?: {
    range: number          // Number of time units to display (default: 30)
    unit: ManipulateType   // Time unit ('minute' | 'hour' | 'day' | 'week' | 'month' | 'year') (default: 'day')
    unitNumber: number     // Increment of time units (default: 1)
    format: string         // Date format using dayjs format (default: 'MM/DD')
  }
  tableCellWidth?: number  // Width of each time unit column in pixels (default: 60)
  startDate?: Date | string  // Calendar start date (default: current date)
}

Data

{
  columns: Column[]        // Column headers for the row head section
  rows: {
    heads: RowHeadProp[]   // Hierarchical row header structure
    contents: RowContent[] // Row content with events
  }
}

Column

{
  label: string | (() => React.ReactNode)
}

RowHeadProp

{
  id: string | number
  label: string | (() => React.ReactNode)
  children?: RowHeadProp[]
}

RowContent

{
  headIds: Array<string | number>  // Path of row head IDs (e.g., ['1', '1-1', '1-1-1'])
  events: Event[]
}

Event

{
  label: string | React.FC<{ width: number }>
  startAt: Date
  endAt: Date
}

Examples

Daily View (30 days)

<ReactGanttCalendar
  options={{
    displayRange: {
      range: 30,
      unit: 'day',
      unitNumber: 1,
      format: 'MM/DD'
    },
    startDate: new Date()
  }}
  data={{
    // ... columns and rows
  }}
/>

Hourly View (24 hours)

<ReactGanttCalendar
  options={{
    displayRange: {
      range: 24,
      unit: 'hour',
      unitNumber: 1,
      format: 'HH:mm'
    },
    startDate: new Date()
  }}
  data={{
    // ... columns and rows
  }}
/>

30-Minute Intervals

<ReactGanttCalendar
  options={{
    displayRange: {
      range: 48,
      unit: 'minute',
      unitNumber: 30,
      format: 'HH:mm'
    },
    startDate: new Date()
  }}
  data={{
    // ... columns and rows
  }}
/>

Custom Event Labels

Events can use custom React components that receive the calculated width:

data={{
  columns: [{ label: 'Room' }],
  rows: {
    heads: [{ id: '1', label: 'Room 101' }],
    contents: [
      {
        headIds: ['1'],
        events: [
          {
            label: ({ width }) => (
              <button style={{ width, textAlign: 'left' }}>
                Custom Button
              </button>
            ),
            startAt: new Date('2025-01-15'),
            endAt: new Date('2025-01-20')
          }
        ]
      }
    ]
  }
}}

License

MIT