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

@ganttkit/react

v0.2.0

Published

React 19 Gantt chart component for GanttKit - a <GanttChart> binding over the HTML, SVG or canvas renderer.

Readme

@ganttkit/react

React 19 bindings for GanttKit.

This is a binding, not a fourth renderer. The chart is painted by one of the three base renderers - @ganttkit/html by default - and this package only owns that renderer's lifetime and wires it to React's. Every feature plugin (columns, tree, dependencies, markers, tooltip, selection, i18n, ...) works unchanged, because none of them know a framework is involved.

Install

pnpm add @ganttkit/react @ganttkit/html @ganttkit/core

Usage

import { useState } from 'react'
import type { GanttRow, ViewMode } from '@ganttkit/core'
import { GanttChart } from '@ganttkit/react'
import { createTree } from '@ganttkit/plugin-tree'
import '@ganttkit/react/styles.css'

const ROWS: GanttRow[] = [
  { id: 'design', name: 'Design', tasks: [{ id: 't1', name: 'Wireframes', start: '2026-06-15', end: '2026-07-08' }] },
]
const PLUGINS = [createTree().plugin]

export function Chart() {
  const [viewMode, setViewMode] = useState<ViewMode>('Week')
  return (
    <GanttChart
      rows={ROWS}
      plugins={PLUGINS}
      viewMode={viewMode}
      onViewModeChange={({ viewMode }) => setViewMode(viewMode)}
      onTaskClick={({ task }) => console.log(task.name)}
      style={{ height: '70vh' }}
    />
  )
}

The root element needs a height. className and style are passed to it, and the renderer adds its own gantt class on top.

Choosing a renderer

The chart is painted by @ganttkit/html unless you say otherwise. Pass renderer to paint with SVG or canvas instead, and import that package's stylesheet rather than @ganttkit/react/styles.css:

import { GanttChart } from '@ganttkit/react'
import { canvasRenderer } from '@ganttkit/canvas'
import '@ganttkit/canvas/styles.css'

<GanttChart renderer={canvasRenderer} rows={rows} style={{ height: '70vh' }} />

| Renderer | Package | Stylesheet | Paints each primitive as | | --- | --- | --- | --- | | htmlRenderer (default) | @ganttkit/html | @ganttkit/react/styles.css | a positioned <div> | | svgRenderer | @ganttkit/svg | @ganttkit/svg/styles.css | an SVG element | | canvasRenderer | @ganttkit/canvas | @ganttkit/canvas/styles.css | a draw call on one 2D canvas |

@ganttkit/svg and @ganttkit/canvas are optional peers - install the one you use. @ganttkit/react/styles.css re-exports the HTML sheet only, because it is the only renderer this package depends on; for the other two, import the stylesheet from the same package you import the renderer from.

Anything matching RendererFactory works, so a custom renderer drops in the same way:

import type { GanttPlugin, RendererOptions } from '@ganttkit/core'

const myRenderer = (options: RendererOptions): GanttPlugin => ({ ... })

renderer is a rebuild prop: swapping it tears the engine down and builds a fresh one with the new renderer.

Props

Every GanttOptions field, plus renderer, theme, enableZoom, enablePan, chevron and plugins.

They fall into three groups, which is the whole reactivity contract:

| Group | Props | Behaviour on change | | --- | --- | --- | | Live | rows, viewMode, theme, dateAdapter | pushed into the running engine | | Rebuild | renderer, rowHeight, dayWidth, barPadding, highlightToday, draggable, virtualize, overscanRows, overscanCols, startDate, endDate, enableZoom, enablePan | the engine is torn down and rebuilt | | Read once | plugins, chevron | read when the engine is built |

Rebuilds key off the option values, not object identity, so a re-render with the same numbers never rebuilds. renderer is the exception: a function has no value to compare, so it keys off identity - hoist it out of the component or memoize it. plugins is read once, so an inline array is safe too - but keep the plugin instances stable if you want their state (a tree's collapsed set, a filter's predicate) to survive a rebuild.

Callbacks

onReady (the live GanttEngine), onTaskClick, onTaskDblClick, onTaskHover, onTaskHoverEnd, onTaskDragStart, onTaskDragMove, onTaskDragEnd, onViewModeChange, onDateRangeChange, onRowsChange, onSelectionChange and onRowToggle.

They are read through a ref at call time, so they never need memoizing and never cause a rebuild.

scene:change is deliberately not forwarded - it fires on every scroll frame. Subscribe to it on the engine itself when you need it, via onReady or the ref handle:

const chart = useRef<GanttChartHandle>(null)
chart.current?.engine?.events.on('scene:change', ({ reason }) => { /* ... */ })

useGantt

For custom layouts, the hook behind the component is exported too. It owns an engine for the lifetime of the component and applies the same three-group contract:

const host = useRef<HTMLDivElement>(null)
const engine = useGantt(host, { rows, viewMode: 'Week' })
return <div ref={host} style={{ height: '70vh' }} />

Examples

  • examples/basic - pnpm --filter @ganttkit/example-react dev
  • examples/stress - large-dataset benchmark with a live metrics panel: pnpm --filter @ganttkit/example-react-stress dev