Package installation
CSS import
The package ships two CSS bundles. Import one of them once — typically at your app entry point or root layout.Peer dependencies
@svar-ui/react-gantt requires React and react-dom as peer dependencies. They are not installed automatically.
| Package | Required version |
|---|---|
react | >=18 |
react-dom | >=18 |
TypeScript
TypeScript types are bundled with the package — no separate@types/* installation is needed.
The main types you will use are:
| Type | Description |
|---|---|
ITask | Shape of a single task object (id, text, start, end, …) |
IApi | API instance returned by the init prop. |
IConfig | All configuration props accepted by <Gantt>. |
Types are re-exported from
@svar-ui/gantt-store, so you can also import them from there if you need lower-level access. For day-to-day use, importing from @svar-ui/react-gantt is sufficient.Version compatibility
@svar-ui/react-gantt | React | Node.js |
|---|---|---|
| 2.x (current) | 18, 19 | 18+ |
Framework setup
Vite
No additional configuration is required. The package uses the ES module format (type: "module") and Vite resolves it out of the box.
vite.config.js
webpack 5
webpack 5 resolves ES modules natively. Ensure you have@babel/preset-react (or the equivalent SWC transform) configured for JSX.
webpack.config.js
Next.js
The package is an ES module. If you are on Next.js 13+ with the App Router you can import it directly in a Client Component.app/gantt/page.jsx
ERR_REQUIRE_ESM on older Next.js versions (Pages Router, Node < 18), add the package to transpilePackages in your Next.js config:
next.config.js