> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pharen.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Gantt

> Import and use the Gantt components from @pharen/ui.

export const PharenUiPreview = ({name, title = 'Pharen UI component preview'}) => <div className="not-prose my-6 overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm dark:border-white/10 dark:bg-zinc-950">
    <div className="pharen-ui-preview-root" data-pharen-ui-preview data-example={name} role="region" aria-label={title} />
  </div>;

Use **Gantt** to visualize work across a project timeline. This page covers every Vue component exported by the public module.

<PharenUiPreview name="gantt" title="Gantt preview" />

<Accordion title="View code">
  ```vue theme={null}
  <script setup lang="ts">
  import { GanttFeatureItem, GanttFeatureList, GanttFeatureListGroup, GanttHeader, GanttProvider, GanttSidebar, GanttSidebarGroup, GanttSidebarItem, GanttTimeline, GanttToday } from '@pharen/ui';

  const group = { id: 'launch', name: 'Product launch' };
  const status = { id: 'active', name: 'Active', color: 'var(--primary)' };
  const features = [
    { id: 'research', name: 'Research', startAt: new Date(2026, 7, 4), endAt: new Date(2026, 7, 11), status, group, progress: 100 },
    { id: 'design', name: 'Design', startAt: new Date(2026, 7, 9), endAt: new Date(2026, 7, 19), status: { ...status, id: 'design', color: 'var(--info)' }, group, progress: 62 },
    { id: 'release', name: 'Release', startAt: new Date(2026, 7, 20), endAt: new Date(2026, 7, 25), status: { ...status, id: 'release', color: 'var(--warning)' }, group, progress: 15 },
  ];
  </script>

  <template>
    <div class="h-72 w-full overflow-hidden rounded-xl border">
      <GanttProvider range="daily" :zoom="80">
        <GanttSidebar>
          <GanttSidebarGroup name="Product launch">
            <GanttSidebarItem v-for="feature in features" :key="feature.id" :feature="feature" />
          </GanttSidebarGroup>
        </GanttSidebar>
        <GanttTimeline>
          <GanttHeader />
          <GanttFeatureList>
            <GanttFeatureListGroup>
              <GanttFeatureItem v-for="feature in features" :key="feature.id" :feature="feature" />
            </GanttFeatureListGroup>
          </GanttFeatureList>
          <GanttToday />
        </GanttTimeline>
      </GanttProvider>
    </div>
  </template>
  ```
</Accordion>

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @pharen/ui
  ```

  ```bash pnpm theme={null}
  pnpm add @pharen/ui
  ```

  ```bash yarn theme={null}
  yarn add @pharen/ui
  ```

  ```bash bun theme={null}
  bun add @pharen/ui
  ```
</CodeGroup>

<Note>
  Import `@pharen/ui/styles.css` exactly once in your application entrypoint.
</Note>

## Usage

```ts theme={null}
import { GanttProvider, GanttSidebar, GanttSidebarGroup, GanttSidebarItem, GanttTimeline, GanttHeader, GanttFeatureList, GanttFeatureListGroup, GanttFeatureItem, GanttMarker, GanttToday } from '@pharen/ui';
```

## Exports

| Export                  | Purpose                                  |
| ----------------------- | ---------------------------------------- |
| `GanttProvider`         | Exported Vue component from this module. |
| `GanttSidebar`          | Exported Vue component from this module. |
| `GanttSidebarGroup`     | Groups related items.                    |
| `GanttSidebarItem`      | Represents one item.                     |
| `GanttTimeline`         | Exported Vue component from this module. |
| `GanttHeader`           | Structures the header region.            |
| `GanttFeatureList`      | Exported Vue component from this module. |
| `GanttFeatureListGroup` | Groups related items.                    |
| `GanttFeatureItem`      | Represents one item.                     |
| `GanttMarker`           | Exported Vue component from this module. |
| `GanttToday`            | Exported Vue component from this module. |

## Source

[Open the source on GitHub](https://github.com/PharenIT/ELEV8-Labs/tree/main/src/packages/ui/src/components/gantt)
