GhostGantt reference
Package: @ghostvue/vue. Status: experimental (stability policy).
Headless, date-only Gantt chart over an app-owned schedule: a named treegrid whose rows read a task's title, inclusive dates, and finish-to-start dependencies (including links to tasks that are not in the schedule), aligned with an aria-hidden timeline of bars, milestones, connectors, and a today marker. One Tab stop with row focus, hierarchy keys, controlled selection, and an Edit dates dialog that proposes one editRequest; the application accepts by supplying revised tasks or rejects through taskErrors. The chart never schedules.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
defaultExpanded | 'all' | readonly string[] | "all" | No | Initial expanded parents when `expanded` is omitted. |
dependencies | readonly GanttDependency[] | "[]" | No | Finish-to-start links, rendered as supplied, including overlapping and dangling dependencies. |
dir | GanttDirection | — | No | Timeline and arrow direction. When omitted, read from the root's computed `direction` in the browser. |
expanded | readonly string[] | — | No | Controlled expanded parent IDs (`v-model:expanded`). Omit for uncontrolled. |
locale | string | "en-US" | No | `Intl` locale for date text. Explicit so SSR and hydration format identically. |
messages | Partial<GanttMessages> | — | No | Overrides for labels, descriptions, and announcements. |
range | GanttRange | — | Yes | Inclusive visible dates. Required so server and client markup agree. |
selected | readonly string[] | — | No | Controlled selection (`v-model:selected`). When omitted, rows have no selection state. |
selectionMode | GanttSelectionMode | "single" | No | Used only when `selected` is bound. |
taskErrors | readonly GanttTaskError[] | "[]" | No | App-controlled messages; the chart never adds or clears entries. |
tasks | readonly GanttTask[] | — | Yes | App-owned tasks. Sibling order is array order. Never sorted, filtered, cloned, or mutated. |
today | CalendarDate | — | No | Optional today marker. Never computed with `new Date()`. |
Emits
| Name | Payload | Description |
|---|---|---|
editRequest | GanttEditRequest | Proposes a completed, changed edit once, after Save in the Edit dates dialog: the dialog has closed and focus is back on the row. Not emitted for unchanged dates, Cancel, Escape, or when the task is removed or becomes read-only. The intent is derived from the authoritative and proposed dates. Answer every request with revised tasks or a new taskErrors entry object. |
Models
| Prop | Event | Type | Description |
|---|---|---|---|
expanded | update:expanded | readonly string[] | Expanded parent IDs. Emits the full next array on a key or pointer toggle; IDs that are not parents or not in tasks are kept. |
selected | update:selected | readonly string[] | Selected task IDs. Emits the full next array on Space; the chart never prunes an ID because its row is hidden or absent. |
Slots
| Name | Description |
|---|---|
bar | Visual label inside a bar. `aria-hidden`; must not contain focusable content. |
empty | Content of the empty chart. |
task | Title cell content. Must render text; the row's name is read from it. Default: `task.title`. |
Slot props: bar
| Name | Type | Description |
|---|---|---|
error | string | undefined | Message of this task's `taskErrors` entry, if any. |
expanded | boolean | undefined | Expansion of a parent row; `undefined` for a leaf. |
level | number | 1-based hierarchy level. |
preview | GanttScheduledDates | undefined | Preview dates while this task is being edited by a gesture. |
selected | boolean | undefined | Selection state; `undefined` when `selected` is not bound. |
task | GanttTask | Slot prop `task`. |
Slot props: empty
None declared.
Slot props: task
| Name | Type | Description |
|---|---|---|
error | string | undefined | Message of this task's `taskErrors` entry, if any. |
expanded | boolean | undefined | Expansion of a parent row; `undefined` for a leaf. |
level | number | 1-based hierarchy level. |
preview | GanttScheduledDates | undefined | Preview dates while this task is being edited by a gesture. |
selected | boolean | undefined | Selection state; `undefined` when `selected` is not bound. |
task | GanttTask | Slot prop `task`. |
Exposed members
| Name | Type | Description |
|---|---|---|
announce | (message: string) => void | Sends a polite message through the chart's status element. |
focusTask | (id: string) => boolean | Focuses a visible row and makes it the Tab target. `false` if hidden or absent. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | Outer element. Consumer class and style land here. |
data-part | treegrid | The named role="treegrid" element and the one scroll surface for the task list and timeline. Every other fallthrough attribute lands here. |
data-part | header | The column header row: Task, Dates, Dependencies, and the aria-hidden timeline header with month and day labels. |
data-part | row | A task row (role="row") and the roving focus target. |
data-part | title | The Task cell (role="rowheader") and its column header. Holds the task slot. |
data-part | toggle | Pointer-only, aria-hidden expand and collapse control in a parent row's Task cell. |
data-part | dates | The Dates cell: dates text, the Edit dates button, and any error. |
data-part | edit-button | Native Edit dates button (tabindex="-1") in an editable row's Dates cell. Keyboard users press Enter or F2 on the row. |
data-part | dependencies | The Dependencies cell, which describes the row. |
data-part | timeline | The aria-hidden timeline cell of the header and of each row. It has no per-day elements; draw the day grid as a background. |
data-part | bar | A span's bar, positioned by --ghost-gantt-offset and --ghost-gantt-days. Holds the bar slot. |
data-part | milestone | A milestone marker, positioned by --ghost-gantt-offset (the day column of its date). |
data-part | connector | A finish-to-start connector between two visible, scheduled tasks, positioned by its from/to day and row custom properties. |
data-part | today | The today marker, positioned by --ghost-gantt-offset. |
data-part | error | A visible taskErrors message, in the row's Dates cell and in the editor. |
data-part | empty | The cell holding the empty slot when there are no tasks. |
data-part | status | Visually hidden polite status element after the treegrid that carries every announcement. |
data-part | editor-form | The form inside the Edit dates dialog. |
data-part | field | One date field in the editor, with its label, date picker, and field error. |
data-part | field-error | A structural validation error on an editor field. |
data-part | editor-notice | Visible editorRefreshed notice in the editor after an external date change. |
data-part | save | The editor's Save (submit) button. |
data-part | cancel | The editor's Cancel button. |
data-kind | span, milestone, unscheduled | On rows, bars, and milestones: the schedule kind that renders. |
data-level | 1, 2, 3 | On rows: the 1-based hierarchy level (any positive integer). |
data-expanded | present | Present on expanded parent rows and their toggle. |
data-selected | present | Present on selected rows when selected is bound. |
data-editable | present | Present on editable rows, bars, and milestones. |
data-invalid | present | Present on rows with a taskErrors entry. |
data-clipped-start | present | Present on a bar whose start is before range.start. |
data-clipped-finish | present | Present on a bar whose finish is after range.finish. |
data-dangling | present | Present on a dependency line whose other task is not in tasks. |
data-gantt-layer | present | Present on the aria-hidden layer that holds the today marker and connectors. |
data-gantt-month | present | Present on month labels in the timeline header. |
data-gantt-day | present | Present on day labels in the timeline header. |
data-ghost-gantt-editor | present | Present on the Edit dates dialog content, which is portaled to the body. |
data-ghost-gantt-editor-overlay | present | Present on the Edit dates dialog overlay. |
CSS variables
| Name | Description |
|---|---|
--ghost-gantt-day-width | Set by your stylesheet: the width of one day column. |
--ghost-gantt-row-height | Set by your stylesheet: the height of one row, used to place connectors. |
--ghost-gantt-range-days | Set on the treegrid: the number of day columns in range. |
--ghost-gantt-offset | Set on bars, milestones, the today marker, and header labels: day columns from range.start. |
--ghost-gantt-days | Set on bars and header labels: visible day columns. |
--ghost-gantt-rows | Set on the layer: the number of visible rows. |
--ghost-gantt-from-day | Set on connectors: the predecessor's finish edge (or marker centre) in day columns. |
--ghost-gantt-from-row | Set on connectors: the predecessor's visible row index. |
--ghost-gantt-to-day | Set on connectors: the successor's start edge (or marker centre) in day columns. |
--ghost-gantt-to-row | Set on connectors: the successor's visible row index. |
Accessibility
Role: treegrid. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/treegrid/.
Required ARIA attributes: aria-label, aria-level, aria-setsize, aria-posinset, aria-expanded, aria-selected, aria-readonly.
Keyboard
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Passed | Every declared key maps to a Chromium browser test that CI runs and requires to pass on every commit. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
gantt/release-plan
A named treegrid with one Tab stop: rows read their title, inclusive dates, and finish-to-start dependencies, including a link to a task that is not in the schedule. Arrow keys move between rows and expand or collapse the release.
gantt/edit-dates
Enter opens Edit dates on an editable row. The chart proposes one edit request; the application accepts it by supplying revised tasks, announces its own downstream changes with announce(), or rejects it with a taskErrors entry that is shown and announced.