@bryntum/gantt-react

中文文档
7.3.8发布于 2026/10/28CommercialTypeScriptESM + CJS零依赖近 30 天下载 3841

React wrappers for Bryntum Gantt JavaScript component

原始使用文档
文档目录13 节
  1. Version Requirement
  2. Package Contents
  3. Installation
  4. React Wrapper
  5. Component Package (Required)
  6. Try Bryntum Online Demos
  7. Quick Start
  8. Integration Guide
  9. Wrappers
  10. Features
  11. Explore All Bryntum Products
  12. Online references
  13. License and copyright


Bryntum logo       React


React wrapper for Bryntum Gantt

This package contains a wrapper that encapsulates Bryntum Gantt and turns it into a React component, exposing configuration options, properties, features, and events.

Version Requirement

  • React: 18 or higher
  • TypeScript: 4.2 or higher
  • Vite 5 or higher

Package Contents

PathDescription
lib/React wrapper components (BryntumGantt etc.)
src/Original source files

Installation

React Wrapper

npm install @bryntum/gantt-react@latest

Component Package (Required)

npm install @bryntum/gantt@latest

Try Bryntum Online Demos

Quick Start

Replace your App.tsx with the following:

import { FunctionComponent, useRef } from 'react';
import { BryntumGantt } from '@bryntum/gantt-react';
import { ganttProps } from './Config';
import './App.scss';

const App: FunctionComponent = () => {
    const gantt = useRef<BryntumGantt>(null);

    return <BryntumGantt ref={gantt} {...ganttProps} />;
};

export default App;

Create a GanttConfig.ts file in the src/ directory with the following content:

import { BryntumGanttProps } from '@bryntum/gantt-react';

const ganttProps : BryntumGanttProps = {
    startDate  : new Date(2026, 0, 1),
    endDate    : new Date(2026, 2, 1),
    columns    : [{ type : 'name', field : 'name', width : 250 }],
    viewPreset : 'weekAndDayLetter',
    barMargin  : 10,

    project : {
        transport : {
            load : {
                url : 'data.json'
            }
        },
        autoLoad           : true,
        // Automatically introduces a `startnoearlier` constraint for tasks that (a) have no predecessors, (b) do not use
        // constraints and (c) aren't `manuallyScheduled`
        autoSetConstraints : true
    }
};

export { ganttProps };
Create sample data (click to expand)

Create a public/data/data.json file for example data and add the following JSON data to it:

{
  "success": "true",
  "tasks": {
    "rows": [
      {
        "id": 1,
        "name": "Documentation Project",
        "expanded": true,
        "children": [
          {
            "id": 2,
            "name": "Preparation",
            "expanded": true,
            "children": [
              { "id": 6, "name": "Proof-read docs", "startDate": "2026-01-02", "endDate": "2026-01-09" },
              { "id": 3, "name": "Release docs",    "startDate": "2026-01-09", "endDate": "2026-01-10" }
            ]
          },
          {
            "id": 4,
            "name": "Development",
            "expanded": true,
            "children": [
              { "id": 7, "name": "Write API docs",  "startDate": "2026-01-05", "endDate": "2026-01-12" },
              { "id": 8, "name": "Write tutorials", "startDate": "2026-01-10", "endDate": "2026-01-16" },
              { "id": 9, "name": "Create examples", "startDate": "2026-01-12", "endDate": "2026-01-18" }
            ]
          },
          {
            "id": 5,
            "name": "Review & Release",
            "expanded": true,
            "children": [
              { "id": 10, "name": "Team review",     "startDate": "2026-01-18", "endDate": "2026-01-20" },
              { "id": 11, "name": "Final approval",  "startDate": "2026-01-20", "endDate": "2026-01-21" },
              { "id": 12, "name": "Public release",  "startDate": "2026-01-22", "endDate": "2026-01-22" }
            ]
          }
        ]
      }
    ]
  },
  "dependencies": {
    "rows": [
      { "fromTask": 6,  "toTask": 3  },
      { "fromTask": 7,  "toTask": 8  },
      { "fromTask": 8,  "toTask": 9  },
      { "fromTask": 9,  "toTask": 10 },
      { "fromTask": 10, "toTask": 11 },
      { "fromTask": 11, "toTask": 12 }
    ]
  }
}

This is the data the Bryntum Gantt will use.

Lastly, add some styling to your App.css or index.css:

/* FontAwesome is used for icons */
@import '@bryntum/gantt/fontawesome/css/fontawesome.css';
@import '@bryntum/gantt/fontawesome/css/solid.css';
/* Structural CSS */
@import "@bryntum/gantt/gantt.css";
/* Bryntum theme of your choice */
@import "@bryntum/gantt/svalbard-light.css";

Integration Guide

For details on installing and using this package, see the React Integration Guide.

Wrappers

React wrappers encapsulate Bryntum components as native React components, exposing all configuration options, properties, features, and events through React-familiar patterns like props and callbacks.

Visit Wrappers documentation for the complete list of available wrapper components.

Features

Features are optional modules that extend Bryntum Gantt functionality. Each feature is suffixed with Feature and can be enabled and configured through standard React props.

Visit Features documentation for the complete list of available features and their configuration options.

Explore All Bryntum Products

Explore our comprehensive collection of demos:

ProductJavaScript
JavaScript
React
React
Vue
Vue
Angular
Angular
GridGrid JavaScript demosGrid React demosGrid Vue demosGrid Angular demos
SchedulerScheduler JavaScript demosScheduler React demosScheduler Vue demosScheduler Angular demos
Scheduler ProScheduler Pro JavaScript demosScheduler Pro React demosScheduler Pro Vue demosScheduler Pro Angular demos
GanttGantt JavaScript demosGantt React demosGantt Vue demosGantt Angular demos
CalendarCalendar JavaScript demosCalendar React demosCalendar Vue demosCalendar Angular demos
TaskBoardTaskBoard JavaScript demosTaskBoard React demosTaskBoard Vue demosTaskBoard Angular demos

Online references

This wrapper depends on Bryntum Gantt, which is commercial software and requires a paid license. Please visit the Bryntum Gantt End User License for the full text of the license.

Copyright © 2009-2026, Bryntum All rights reserved.

版本与发布记录

@bryntum/gantt-react 共发布 17 个版本,首次发布于 2026/01/22;过去 12 个月发布了 17 个版本。

版本发布日期距今
7.3.8latest2026/10/2811 天前
7.3.72026/09/241 个月前
7.3.62026/09/111 个月前
7.3.52026/08/212 个月前
7.3.42026/07/223 个月前
7.3.32026/06/254 个月前

关于 @bryntum/gantt-react 的常见问题

@bryntum/gantt-react 是什么?

React wrappers for Bryntum Gantt JavaScript component

如何安装 @bryntum/gantt-react?

在项目目录运行 npm install @bryntum/gantt-react,或使用 pnpm add / yarn add / bun add。

@bryntum/gantt-react 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bryntum/gantt-react 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@bryntum/gantt-react 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=0.10.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bryntum/gantt-react 可以商用吗?

@bryntum/gantt-react 使用 Commercial 许可。声明的许可为 Commercial,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@bryntum/gantt-react 的下载量有多少?

根据 npm 官方下载统计,@bryntum/gantt-react 在 2026/10/09 – 2026/11/07 这 30 天内被下载 3,841 次,日均约 128 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bryntum/gantt-react 还在维护吗?

最新版本 7.3.8 发布于 2026/10/28(11 天前);至今共发布 17 个版本,其中过去 12 个月发布了 17 个;首次发布于 2026/01/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。