Birch UI v0.1
Pricing

Gantt overviewGantt

A project scheduling component with a task tree, a timeline and a critical-path engine, working calendars, MS Project XML exchange and a headless engine for servers.

Open .md

Birch UI Gantt is a project scheduling component: a task tree on the left, a timeline on the right, and a critical-path scheduling engine underneath. Planners build the schedule by typing durations and predecessors or by dragging bars, and the engine moves every dependent task on its working calendar, the way desktop project tools do.

It is written in plain TypeScript, renders to the DOM and follows the shared Birch UI widget contract, so it works in any framework. The task list is built on the MIT Birch UI Grid core, so no Grid Pro license is needed.

Warehouse fit-out project

Loading demo…

View source

Sample data and small UI helpers are imported from the docs' demos/_shared.ts and demos/_scheduler-data.ts files.

demos/gantt-project.ts
import { createGantt, type GanttDependency, type GanttTask } from '@birchui/gantt';
import { button, docsTheme, layout, onDocsThemeChange } from './_shared';

export const meta = { title: 'Warehouse fit-out project', height: 560 };

const tasks: GanttTask[] = [
  { id: 'plan', name: 'Planning', type: 'summary', expanded: true },
  { id: 'survey', parentId: 'plan', name: 'Site survey', start: '2027-01-04', duration: 3 },
  { id: 'design', parentId: 'plan', name: 'Racking layout design', duration: 5 },
  { id: 'permits', parentId: 'plan', name: 'Building permits', duration: 10 },
  { id: 'signoff', parentId: 'plan', name: 'Design sign-off', type: 'milestone', duration: 0 },
  { id: 'build', name: 'Fit-out', type: 'summary', expanded: true },
  { id: 'floor', parentId: 'build', name: 'Floor resurfacing', duration: 6 },
  { id: 'electrical', parentId: 'build', name: 'Electrical and lighting', duration: 8 },
  { id: 'racking', parentId: 'build', name: 'Install pallet racking', duration: 7 },
  { id: 'conveyor', parentId: 'build', name: 'Conveyor installation', duration: 9 },
  { id: 'golive', name: 'Go-live', type: 'summary', expanded: true },
  { id: 'wms', parentId: 'golive', name: 'Warehouse system configuration', duration: 6 },
  { id: 'training', parentId: 'golive', name: 'Staff training', duration: 4 },
  { id: 'handover', parentId: 'golive', name: 'Handover to operations', type: 'milestone', duration: 0 },
];

const links: [string, string, GanttDependency['type'], number?][] = [
  ['survey', 'design', 'FS'],
  ['design', 'permits', 'SS', 2],
  ['design', 'signoff', 'FS'],
  ['permits', 'signoff', 'FS'],
  ['signoff', 'floor', 'FS'],
  ['signoff', 'electrical', 'FS'],
  ['floor', 'racking', 'FS', 1],
  ['electrical', 'conveyor', 'SS', 3],
  ['racking', 'conveyor', 'FF'],
  ['signoff', 'wms', 'FS', 5],
  ['conveyor', 'training', 'FS'],
  ['wms', 'training', 'FS'],
  ['training', 'handover', 'FS'],
];

const dependencies: GanttDependency[] = links.map(([from, to, type, lag], index) => ({
  id: `d${index + 1}`,
  from,
  to,
  type,
  ...(lag ? { lag } : {}),
}));

export default function mount(el: HTMLElement): () => void {
  const { toolbar, body, status } = layout(el);
  const gantt = createGantt(body, {
    tasks,
    dependencies,
    projectStart: '2027-01-04',
    viewPreset: 'weekAndDay',
    showCriticalPath: true,
    calendars: [
      {
        id: 'uk',
        name: 'UK working days',
        workingDays: [1, 2, 3, 4, 5],
        exceptions: [{ start: '2027-01-01', isWorking: false, name: "New Year's Day" }],
      },
    ],
    calendarId: 'uk',
    theme: docsTheme(),
    height: '100%',
    ariaLabel: 'Warehouse fit-out schedule',
  });
  const undo = button('Undo', () => gantt.undo());
  const redo = button('Redo', () => gantt.redo());
  const syncHistory = () => {
    undo.disabled = !gantt.canUndo();
    redo.disabled = !gantt.canRedo();
  };
  const describeFinish = () => {
    const { end } = gantt.getProjectRange();
    return `Project finishes ${end.toDateString()}; ${gantt.getCriticalPath().taskIds.length} tasks are critical.`;
  };
  toolbar.append(
    button('Zoom in', () => gantt.zoomIn()),
    button('Zoom out', () => gantt.zoomOut()),
    undo,
    redo,
    'Drag a bar to move it, drag its end to change the duration, or drag from a bar edge to another bar to link them.',
  );
  const offs = [
    gantt.on('tasksScheduled', ({ changed, ms }) => {
      status.textContent = `Rescheduled ${changed.length} task(s) in ${ms.toFixed(1)} ms. ${describeFinish()}`;
      syncHistory();
    }),
    gantt.on('cycleDetected', () => {
      status.textContent = 'That link would create a cycle, so it was not added.';
    }),
    gantt.on('taskClick', ({ task }) => {
      const slack = gantt.getSlack(task.id);
      const critical = slack?.isCritical ? ', on the critical path' : '';
      status.textContent = `${task.name}: ${task.start.toDateString()} to ${task.end.toDateString()}${critical}.`;
    }),
  ];
  syncHistory();
  status.textContent = describeFinish();
  const stopTheme = onDocsThemeChange((theme) => gantt.update({ theme }));
  return () => {
    for (const off of offs) off();
    stopTheme();
    gantt.destroy();
  };
}

What it does#

  • Tasks of type task, milestone and summary, nested with parentId, with progress, colors and baselines. See Tasks.
  • Dependencies FS, SS, FF and SF with lag or lead in working or elapsed time. See Dependencies.
  • Working calendars with working days, hours, breaks, holidays and working exceptions, one for the project and one per task. See Calendars.
  • Scheduling: forward and backward pass (CPM), the eight MS Project constraints, total and free slack, the critical path, manually scheduled tasks and loop detection. Edits reschedule only what they affect. See Scheduling.
  • Editing in the task grid (including predecessor text such as 3FS+2d, 5SS) and on the timeline (move, resize, progress, drawing links), with indent and outdent, undo and redo. See Task grid and Interactions.
  • Exchange: MS Project XML export and import, JSON, and a headless engine for Node and workers. See MS Project XML and Headless engine.
  • Accessibility: a WAI-ARIA treegrid task list, focusable bars with keyboard moving, resizing and linking, and live announcements. See Keyboard and accessibility.

Install#

Terminal
npm install @birchui/gantt

The package depends on @birchui/core, @birchui/license and @birchui/scheduler (for its time axis engine), which npm installs for you. Styles are injected the first time a Gantt is created; to ship the CSS yourself, pass injectStyles: false and import @birchui/gantt/styles.css.

Create a Gantt#

createGantt(container, options) renders into an element you own and returns the Gantt API. tasks is the only required option.

warehouse-fit-out.ts
import { createGantt } from '@birchui/gantt';

const gantt = createGantt(document.getElementById('fit-out')!, {
  projectStart: '2027-01-04',
  timeZone: 'Europe/London',
  height: 520,
  calendars: [
    {
      id: 'site',
      workingDays: [1, 2, 3, 4, 5],
      workingHours: [
        { from: '08:00', to: '12:00' },
        { from: '13:00', to: '17:00' },
      ],
      exceptions: [{ start: '2027-04-02', end: '2027-04-05', name: 'Easter' }],
    },
  ],
  calendarId: 'site',
  tasks: [
    { id: 'fitout', name: 'Distribution centre fit-out' },
    { id: 'survey', parentId: 'fitout', name: 'Floor survey and racking layout', duration: 3 },
    { id: 'permit', parentId: 'fitout', name: 'Racking permit approved', type: 'milestone' },
    { id: 'floor', parentId: 'fitout', name: 'Floor repairs and sealing', duration: 5 },
    { id: 'racking', parentId: 'fitout', name: 'Install pallet racking', duration: 10, percentDone: 20 },
    { id: 'lighting', parentId: 'fitout', name: 'LED high-bay lighting', duration: 6 },
    { id: 'wms', parentId: 'fitout', name: 'WMS configuration and scanners', duration: 8 },
    { id: 'handover', parentId: 'fitout', name: 'Handover to operations', type: 'milestone' },
  ],
  dependencies: [
    { id: 'd1', from: 'survey', to: 'permit', type: 'FS' },
    { id: 'd2', from: 'survey', to: 'floor', type: 'FS' },
    { id: 'd3', from: 'permit', to: 'racking', type: 'FS' },
    { id: 'd4', from: 'floor', to: 'racking', type: 'FS' },
    { id: 'd5', from: 'racking', to: 'lighting', type: 'SS', lag: 4, lagUnit: 'day' },
    { id: 'd6', from: 'racking', to: 'wms', type: 'FF', lag: 2 },
    { id: 'd7', from: 'lighting', to: 'handover', type: 'FS' },
    { id: 'd8', from: 'wms', to: 'handover', type: 'FS' },
  ],
  showCriticalPath: true,
});

gantt.on('taskChange', ({ task, source }) => saveTask(task.id, { start: task.start, end: task.end, source }));
gantt.on('dependencyCreate', ({ dependency }) => saveLink(dependency));
gantt.on('tasksScheduled', ({ changed, ms }) => console.info(`${changed.length} tasks rescheduled in ${ms} ms`));

The engine places every task: survey starts at the project start, its successors follow, and the fitout summary spans its subtasks. Durations are working days on the site calendar, so Easter and weekends are skipped.

The widget contract#

createGantt returns a GanttApi with the four members every Birch UI component shares:

Member What it does
element The Gantt's root element.
update(partial) Applies only the options you pass, without recreating the Gantt.
on(event, listener) Subscribes to one of the 13 events and returns an unsubscribe function. Payloads are always objects.
destroy() Removes the DOM and releases every listener, timer and animation frame.
TypeScript
gantt.update({ viewPreset: 'weekAndMonth', showBaselines: true });

const stop = gantt.on('cycleDetected', ({ cycles }) => {
  console.warn(`${cycles.length} dependency loops ignored`, cycles);
});

stop();
gantt.destroy();

The API adds task and link editing, scheduling queries (getCriticalPath, getSlack), undo and redo, zoom and navigation, and the file methods (toJSON, fromJSON, toMSProjectXML, fromMSProjectXML). See API and events.

Activate your license#

Set the key once for every Birch UI widget on the page, before the first Gantt is created, or pass it per instance:

TypeScript
import { setLicenseKey } from '@birchui/license';

setLicenseKey(import.meta.env.VITE_BIRCHUI_LICENSE);
TypeScript
createGantt(container, { ...options, licenseKey: 'LQ1.…' });

The Gantt checks the key for the gantt product and passes its root element as the watermark host. Verification happens in the browser with no network call. A missing or invalid key never disables anything: it adds a small watermark and logs one console warning, and on localhost the watermark is skipped. Changing licenseKey through update() re-checks it. The headless engine does not check a license.

Tier Price, one-time
Developer (one named developer) $399
Team (up to 5 developers) $1,499
Company (unlimited developers) $3,999

The Gantt is also included in the Project Suite ($699 per developer, with the Scheduler and the Event Calendar) and in Birch UI Complete. Colleagues who only build or deploy the app need no seat. See Pricing and Licensing and activation.

Use it in your framework#

The framework adapters do not ship a Gantt component, but each exports the generic factory its own components are built with. Pass it ganttDefinition (tag name birchui-gantt) to get a component that creates the Gantt on mount, sends changed props to update() and forwards all 13 events.

TypeScript
import { createGantt } from '@birchui/gantt';

const gantt = createGantt(document.getElementById('plan')!, { tasks, dependencies, height: 560 });
gantt.on('taskChange', ({ task }) => saveTask(task));

Notes per adapter:

  • React and Solid: options are props, events are on… props (onTaskChange, onTasksScheduled), and ref gives you the GanttApi.
  • Vue: pass options as attributes or an options object; events are kebab-case (@task-change, @dependency-create); the component exposes api.
  • Angular: injectBirchWidget needs one output per event, so the wrapper declares all 13. Give the host a height.
  • Svelte: createSvelteAction gives you an action whose parameter is the options plus on and onReady.
  • Web Component: createElementClass turns the definition into a custom element. With requiredOptions: ['tasks'] the Gantt is created once tasks is set, so set dependencies and calendars first. Events are kebab-case CustomEvents with the payload in detail, and element.api is the GanttApi.

Passing new tasks or dependencies arrays through any adapter reloads the project and clears the undo history. Keep the arrays stable while the user edits and read changes from the events. See Saving changes.

Next steps#

↑ ↓ to move, Enter to open, Esc to close