# Gantt chart

Inspect project dates and dependencies with an exact timeline and a readable mobile task list.

Access: pro. Category: Data. Kind: composite.

## When to use

- Use it when a page needs inspect project dates and dependencies with an exact timeline and a readable mobile task list.
- Choose it when the data structure, labels, and state are supplied by the application and must remain consumer controlled.

## Alternatives

- Choose analytics-card instead when explore revenue, compare periods and inspect chart values is the actual interface need, rather than gantt chart.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Gantt chart

```sh
npx shadcn@latest add @tidal-pro/gantt-chart
```

Stylesheets: `components/ui/tidal.css`, `components/ui/gantt-chart.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/gantt-chart.css";
import{TidalGanttChart}from"./components/ui/gantt-chart";
export default()=><div className="tidal-scope"><TidalGanttChart onSelectedChange={() => {}} selectedId={"example"} tasks={[{id:"example",label:"Demo",start:"value",end:"value"}]} title={"Demo"}/></div>;
```

## Structured props

- `TidalGanttChart.onSelectedChange: (id: string, event: MouseEvent<HTMLButtonElement>) => void`: Callback invoked when the selected change interaction is proposed.
- `TidalGanttChart.selectedId: string | null`: Required selected id value accepted by this exported component.
- `TidalGanttChart.tasks: ReadonlyArray<TidalGanttTask>`: Required tasks value accepted by this exported component.
- `TidalGanttChart.title: ReactNode`: Required title value accepted by this exported component.
- `TidalGanttChart.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalGanttChart.disabled?: boolean | undefined` (default false): Optional disabled value accepted by this exported component.
- `TidalGanttChart.formatDate?: ((date: string) => string) | undefined` (default (value) => value): Optional format date value accepted by this exported component.
- `TidalGanttChart.headingLevel?: "h2" | "h3" | "h4" | "h5" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalGanttChart.labels?: Partial<{ empty: string; invalid: string; dependencies: string; none: string; period: string; range: string; selected: string; start: string; finish: string; }> | undefined`: Optional labels value accepted by this exported component.
- `TidalGanttChart.referenceDate?: string | undefined`: Optional reference date value accepted by this exported component.
- `TidalGanttChart.referenceLabel?: string | undefined` (default "Reference date"): Optional reference label value accepted by this exported component.
- `TidalGanttChart.taskButtonProps?: ((task: TidalGanttTask) => Omit<ComponentPropsWithoutRef<"button">, "children" | "dangerouslySetInnerHTML" | "type" | "disabled" | "aria-pressed" | "role" | "aria-label" | "aria-labelledby">) | undefined`: Optional task button props value accepted by this exported component.
- `TidalGanttChart.taskButtonRef?: ((task: TidalGanttTask) => Ref<HTMLButtonElement> | undefined) | undefined`: Optional task button ref value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/gantt-chart.tsx) | [Manifest](https://tidalui.com/examples/gantt-chart.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useState } from "react";

import { TidalGanttChart, type TidalGanttTask } from "./components/ui/gantt-chart";

import "./components/ui/gantt-chart.css";



export const sampleTasks: readonly TidalGanttTask[] = [
  {
    id: "research",
    label: "Research & planning",
    start: "2026-10-05",
    end: "2026-10-09",
    detail: "Review the customer interviews and agree on the launch scope.",
  },
  {
    id: "design",
    label: "Design system",
    start: "2026-10-08",
    end: "2026-10-16",
    detail: "Prepare the shared components and responsive screen layouts.",
    dependencies: ["research"],
  },
  {
    id: "build",
    label: "Product development",
    start: "2026-10-14",
    end: "2026-10-27",
    detail: "Implement the agreed flows with the shared design system.",
    dependencies: ["design"],
  },
  {
    id: "review",
    label: "Quality review",
    start: "2026-10-23",
    end: "2026-10-29",
    detail: "Test the main customer journeys on desktop and mobile.",
    dependencies: ["build"],
  },
  {
    id: "launch",
    label: "Launch",
    start: "2026-10-30",
    end: "2026-10-30",
    detail: "Publish the reviewed release.",
    dependencies: ["review"],
  },
];

export function GanttChartDemo() {
  const [selected, setSelected] = useState<string | null>("design");
  return (
    <TidalGanttChart
      title="Website launch"
      description="Select a task to inspect its dates and dependencies."
      tasks={sampleTasks}
      selectedId={selected}
      onSelectedChange={setSelected}
      formatDate={(date) =>
        new Intl.DateTimeFormat("en", {
          month: "short",
          day: "numeric",
          timeZone: "UTC",
        }).format(new Date(`${date}T00:00:00Z`))
      }
      referenceDate="2026-10-15"
      referenceLabel="Review date"
    />
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <GanttChartDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

Consumer-owned tasks require unique nonblank IDs and labels, valid inclusive civil start/end dates, and acyclic references to known dependencies. Up to100 tasks are supported. Dates are normalized as UTC civil days without locale timezone shifts. Invalid data produces a visible error. A supplied reference date adds a marker only within the schedule range. Native task buttons propose controlled selection; caller handlers run first and may prevent. The timeline becomes a date-labelled list in narrow containers, while selected details retain exact dates and dependency names. Native root/action props, cleanup-aware refs, heading levels, formatDate and translated labels are supported. No scheduling, editing, date inference, network or persistence occurs.
