Quick start guide for React integration
Try React demos
Bryntum Gantt ships with several demo React applications that showcase its functionality. Each demo has been tested and confirmed to be compatible with Node.js 20.
Version requirements
Minimum supported:
- React:
16.0.0or higher - TypeScript:
3.6.0or higher (for TypeScript application) - Vite
4.0.0or higher (for application build with Vite)
Recommended:
- React:
18.0.0or higher - TypeScript:
4.0.0or higher (for TypeScript application) - Vite
5.0.0or higher (for application build with Vite)
Overview of React integration
This quick start guide will show you how to integrate Bryntum Gantt into your React applications.
To illustrate the integration process, we'll build a simple application that looks like the image below.
Here's a breakdown of the process we'll follow:
- Access the Bryntum npm registry
- Create a React application
- Install the Gantt component
- Add the component to the application
- Apply styles
- Run the application
Access to npm registry
You can try out Bryntum components for free using our public Bryntum trial packages. If you have a Bryntum license, please refer to our Npm Repository Guide to access the private Bryntum repository.
Create a React application
There are many ways to create and build React applications. In this guide, we’ll use the React Vite guide, which is known for its efficiency and performance benefits in development.
If you’re using JavaScript only (without TypeScript), enter the following command:
npm create vite@latest bryntum-gantt-app -- --template react
Alternatively, if you prefer using TypeScript, use the following command:
npm create vite@latest bryntum-gantt-app -- --template react-ts
You can replace bryntum-gantt-app with your preferred application name.
After creating the template, install the Node.js modules:
cd bryntum-gantt-app
npm install && npm install sass
Install the component
From your terminal, update project dependencies using the following commands:
npm install @bryntum/gantt@npm:@bryntum/gantt-trial@7.3.0 @bryntum/gantt-react@7.3.0
npm install @bryntum/gantt@7.3.0 @bryntum/gantt-react@7.3.0
Managing dependencies and versions
The application configuration may add a caret (^) as a prefix to dependency versions. We recommend avoiding the caret character as a version prefix to maintain full control over upgrades.
Check the generated package.json file and, if necessary, replace dependencies and devDependencies with the following:
"dependencies": {
"@bryntum/gantt": "npm:@bryntum/gantt-trial@7.3.0",
"@bryntum/gantt-react": "7.3.0",
...
},
...
"dependencies": {
"@bryntum/gantt": "7.3.0",
"@bryntum/gantt-react": "7.3.0",
...
},
...
Vite Configuration
If you're using Vite to run Bryntum Gantt in development mode, include the package in the optimizeDeps section of the vite.config.js file to prevent bundles from loading multiple times.
Find instructions for optimizing dependencies in Vite applications here.
Add the component to the application
First, create a configuration file in src. This file will contain the Gantt settings.
const ganttProps = {
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 };
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 };
autoSetConstraints to true in the ProjectModel configuration. Add component data
Now add the following content to public/data.json.
{
"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 }
]
}
}
Next, replace the code in the App.jsx or App.tsx file with the following:
import { BryntumGantt } from '@bryntum/gantt-react';
import { ganttProps } from './ganttConfig';
import './App.scss';
function App() {
return <BryntumGantt {...ganttProps} />;
}
export default App;
import { FunctionComponent, useRef } from 'react';
import { BryntumGantt } from '@bryntum/gantt-react';
import { ganttProps } from './ganttConfig';
import './App.scss';
const App: FunctionComponent = () => {
const gantt = useRef<BryntumGantt>(null);
return <BryntumGantt ref={gantt} {...ganttProps} />;
};
export default App;
If you plan to use stateful React collections for data binding, please refer to this guide.
Apply styles
Now you can apply styles to the Bryntum Gantt component.
First, delete the index.css file and remove its import from the main.jsx or main.tsx. This will ensure that no unintended styles are applied.
Next, rename App.css to App.scss and replace its contents with the following:
// FontAwesome is used for icons
@import "@bryntum/gantt/fontawesome/css/fontawesome.css";
@import "@bryntum/gantt/fontawesome/css/solid.css";
// Import gantt's structural CSS
@import "@bryntum/gantt/gantt.css";
// Import your preferred Bryntum theme
@import "@bryntum/gantt/svalbard-light.css";
// Giving our gantt some height
#root {
height: 100vh;
}
This stylesheet imports the Bryntum Gantt structural CSS, the Svalbard theme, and gives the page a two-panel layout, with the scheduler above the utilization view. Bryntum provides five themes with light and dark variants that can be customized.
Learn more about styling your Bryntum Gantt in our style guide.
Run the application
Start the application development server:
npm run dev
You can now access the application in your browser at http://localhost:5173.
Next.js guide
Take a look at the comprehensive guide to using Bryntum Gantt with Next.js on our blog and explore this boilerplate featured in the post.
Troubleshooting
If you run into issues while setting up your Bryntum Gantt component, refer to our troubleshooting guide for Bryntum Gantt with React.
What to do next?
Make the most of Bryntum Gantt in your application by learning more about advanced customization options and data management techniques.
Advanced integration with React
Explore our comprehensive React guide to learn more about how Bryntum Gantt integrates with React and start customizing your application.
Working with data in Bryntum Gantt
Our guide to data binding explains how data can be bound to the component.
Bryntum components often use multiple data collections and entities.
For a detailed explanation of how these elements interact, see our guide to displaying data in Bryntum Gantt.