React/Remix starter
React
This example runs from source. Open the repository to clone, build, and run it locally.
Open on GitHubReact
Remix starter
React Router project that renders a Gantt chart inside a route, with task and link data wired in.
- README.md
- home.tsx
- Gantt.tsx
- demoData.ts
README.md View on GitHub
# DHTMLX React Gantt Quick Start with Remix (React Router)
This project demonstrates how to integrate the DHTMLX React Gantt component with Remix framework (React Router v7+).
Built with React 19+ and React Router 7+, this demo provides a solid foundation for building powerful project management applications with full TypeScript support.
**Related tutorial**:
[https://docs.dhtmlx.com/gantt/integrations/react/remix/](https://docs.dhtmlx.com/gantt/integrations/react/remix/)
## Features:
- Powerful Gantt chart UI for project planning and task management.
- Remix (React Router v7+) integration with modern routing.
- React component driven approach with props controlling Gantt configuration.
- Support for multiple time scales (day, month, year) for flexible project visualization.
- Interactive drag-and-drop functionality for task management.
- Strong TypeScript support for type-safe usage.
## Project Structure:
```
dhx-react-gantt-remix-demo/
├── app/
│ ├── routes/
│ │ └── home.tsx # Main route with Gantt chart integration
│ ├── components/
│ │ └── Gantt/
│ │ └── Gantt.tsx # Gantt chart component
│ ├── data/
│ │ └── demoData.ts # Sample tasks and links data
│ ├── root.tsx # Root layout
│ ├── routes.ts # Routes configuration
│ └── app.css # Global styles and Tailwind configuration
├── react-router.config.ts # React Router configuration
├── vite.config.ts # Vite configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Project dependencies
```
### How to install using npm/yarn
Install dependencies:
```
npm install
```
or
```
yarn
```
### Run the demo on the local server and explore it
#### Start the development server:
```
npm run dev
```
or
```
yarn dev
```
#### Build for production
```
npm run build
```
or
```
yarn build
```
#### Start production server
```
npm start
```
or
```
yarn start
```
## License
Source code in this repo is released under the **MIT License**.
**DHTMLX React Gantt** is a commercial library - use under a valid [DHTMLX license](https://dhtmlx.com/docs/products/licenses.shtml) or evaluation agreement.
## Useful links
[DHTMLX React Gantt product page](https://dhtmlx.com/docs/products/dhtmlxGantt-for-React/)
[DHTMLX Gantt product page](https://dhtmlx.com/docs/products/dhtmlxGantt/)
[Gantt Documentation](https://docs.dhtmlx.com/gantt/)
[React Gantt Documentation](https://docs.dhtmlx.com/gantt/web__react.html)
[Remix Documentation](https://v2.remix.run/docs/start/quickstart)
[React Router Documentation](https://reactrouter.com/home)
[Blog](https://dhtmlx.com/blog/)
[Forum](https://forum.dhtmlx.com/)
app/routes/home.tsx View on GitHub
import GanttChart from '~/components/Gantt/Gantt';
import type { Route } from './+types/home';
import { tasks, links } from '~/data/demoData';
export function meta({}: Route.MetaArgs) {
return [
{ title: 'DHTMLX React Gantt | Remix (React Router) Quick Start' },
{ name: 'description', content: 'DHTMLX React Gantt | Remix (React Router) Quick Start' },
];
}
export default function Home() {
return (
<div style={{ width: '100vw', height: '100vh' }}>
<GanttChart tasks={tasks} links={links} />
</div>
);
}
app/components/Gantt/Gantt.tsx View on GitHub
import { useMemo, useRef } from 'react';
import Gantt, { type ReactGanttRef, type Task, type Link, type GanttConfig } from '@dhtmlx/trial-react-gantt';
import '@dhtmlx/trial-react-gantt/dist/react-gantt.css';
export interface GanttProps {
tasks: Task[];
links: Link[];
}
export default function GanttChart({ tasks, links }: GanttProps) {
const ganttRef = useRef<ReactGanttRef>(null);
const config: GanttConfig = useMemo(
() => ({
grid_width: 500,
scale_height: 90,
scales: [
{ unit: 'year', step: 1, date: '%Y' },
{ unit: 'month', step: 1, date: '%M' },
{ unit: 'day', step: 1, date: '%d %M' },
],
}),
[]
);
return (
<Gantt
ref={ganttRef}
tasks={tasks}
links={links}
config={config}
data={{
save: (entity: string, action: string, data: Task | Link, id: string | number) => {
console.log(`${entity} - ${action} - ${id}`, data);
},
}}
/>
);
}
app/data/demoData.ts View on GitHub
import type { Task, Link } from '@dhtmlx/trial-react-gantt';
export const tasks: Task[] = [
{
id: 1,
text: 'Office itinerancy',
type: 'project',
start_date: new Date(2025, 3, 2),
duration: 17,
progress: 0.4,
parent: 0,
open: true,
},
{
id: 2,
text: 'Office facing',
type: 'project',
start_date: new Date(2025, 3, 2),
duration: 8,
progress: 0.6,
parent: 1,
open: true,
},
{
id: 3,
text: 'Furniture installation',
type: 'project',
start_date: new Date(2025, 3, 11),
duration: 8,
progress: 0.6,
parent: 1,
open: true,
},
{
id: 4,
text: 'The employee relocation',
type: 'project',
start_date: new Date(2025, 3, 13),
duration: 5,
progress: 0.5,
parent: 1,
priority: 3,
open: true,
},
{
id: 5,
text: 'Interior office',
type: 'task',
start_date: new Date(2025, 3, 3),
duration: 7,
progress: 0.6,
parent: 2,
priority: 1,
},
{
id: 6,
text: 'Air conditioners check',
type: 'task',
start_date: new Date(2025, 3, 3),
duration: 7,
progress: 0.6,
parent: 2,
priority: 2,
},
{
id: 7,
text: 'Workplaces preparation',
type: 'task',
start_date: new Date(2025, 3, 12),
duration: 8,
progress: 0.6,
parent: 3,
},
{
id: 8,
text: 'Preparing workplaces',
type: 'task',
start_date: new Date(2025, 3, 14),
duration: 5,
progress: 0.5,
parent: 4,
priority: 1,
},
{
id: 9,
text: 'Workplaces importation',
type: 'task',
start_date: new Date(2025, 3, 21),
duration: 4,
progress: 0.5,
parent: 4,
},
{
id: 10,
text: 'Workplaces exportation',
type: 'task',
start_date: new Date(2025, 3, 27),
duration: 3,
progress: 0.5,
parent: 4,
priority: 2,
},
{
id: 11,
text: 'Product launch',
type: 'project',
start_date: new Date(2025, 3, 2),
duration: 13,
progress: 0.6,
parent: 0,
open: true,
},
{
id: 12,
text: 'Perform Initial testing',
type: 'task',
start_date: new Date(2025, 3, 3),
duration: 5,
progress: 1,
parent: 11,
},
{
id: 13,
text: 'Development',
type: 'project',
start_date: new Date(2025, 3, 3),
duration: 11,
progress: 0.5,
parent: 11,
open: true,
},
{ id: 14, text: 'Analysis', type: 'task', start_date: new Date(2025, 3, 3), duration: 6, progress: 0.8, parent: 11 },
{
id: 15,
text: 'Design',
type: 'project',
start_date: new Date(2025, 3, 3),
duration: 5,
progress: 0.2,
parent: 11,
open: true,
},
{
id: 16,
text: 'Documentation creation',
type: 'task',
start_date: new Date(2025, 3, 3),
duration: 7,
progress: 0,
parent: 11,
priority: 1,
},
{
id: 17,
text: 'Develop System',
type: 'task',
start_date: new Date(2025, 3, 3),
duration: 2,
progress: 1,
parent: 13,
priority: 2,
},
{
id: 25,
text: 'Beta Release',
type: 'milestone',
start_date: new Date(2025, 3, 6),
duration: 0,
progress: 0,
parent: 13,
},
{
id: 18,
text: 'Integrate System',
type: 'task',
start_date: new Date(2025, 3, 10),
duration: 2,
progress: 0.8,
parent: 13,
priority: 3,
},
{ id: 19, text: 'Test', type: 'task', start_date: new Date(2025, 3, 13), duration: 4, progress: 0.2, parent: 13 },
{
id: 20,
text: 'Marketing',
type: 'task',
start_date: new Date(2025, 3, 13),
duration: 4,
progress: 0,
parent: 13,
priority: 1,
},
{
id: 21,
text: 'Design database',
type: 'task',
start_date: new Date(2025, 3, 3),
duration: 4,
progress: 0.5,
parent: 15,
},
{
id: 22,
text: 'Software design',
type: 'task',
start_date: new Date(2025, 3, 3),
duration: 4,
progress: 0.1,
parent: 15,
priority: 1,
},
{
id: 23,
text: 'Interface setup',
type: 'task',
start_date: new Date(2025, 3, 3),
duration: 5,
progress: 0,
parent: 15,
priority: 1,
},
{
id: 24,
text: 'Release v1.0',
type: 'milestone',
start_date: new Date(2025, 3, 18),
duration: 0,
progress: 0,
parent: 11,
},
];
export const links: Link[] = [
{ id: 2, source: 2, target: 3, type: '0' },
{ id: 3, source: 3, target: 4, type: '0' },
{ id: 7, source: 8, target: 9, type: '0' },
{ id: 8, source: 9, target: 10, type: '0' },
{ id: 16, source: 17, target: 25, type: '0' },
{ id: 17, source: 18, target: 19, type: '0' },
{ id: 18, source: 19, target: 20, type: '0' },
{ id: 22, source: 13, target: 24, type: '0' },
{ id: 23, source: 25, target: 18, type: '0' },
];