Gantt Table Head

A Gantt table head is the header section of a Gantt chart grid, wrapping one or more rows that label the columns of the chart. Typically contains a row with a task-name column header and time-period column headers (e.g., weeks, months, sprints). It is designed to be used inside a GanttTable <table> structure.

The component renders a <thead> element and passes through its children, which are expected to be GanttTableTr or <tr> elements containing <th> header cells.

Example

Task
Show demo markup
<thead class="gantt-table-thead"><tr class="gantt-table-tr"><th class="gantt-table-th">Task</th></tr></thead>
Usage example
<script lang="ts">
    import GanttTable from "../GanttTable/GanttTable.svelte";
    import GanttTableHead from "./GanttTableHead.svelte";
    import GanttTableTr from "../GanttTableTr/GanttTableTr.svelte";
</script>

<GanttTable label="Plan">
    <GanttTableHead>
        <GanttTableTr>
            <th>Task</th><th>Start</th><th>End</th>
        </GanttTableTr>
    </GanttTableHead>
</GanttTable>
Show Svelte source
// In your Svelte component:
import GanttTableThead from "lily-design-system-svelte-headless/components/GanttTableThead/GanttTableThead.svelte";

<GanttTableThead>
  <!-- GanttTableThead content -->
</GanttTableThead>

Usage

<GanttTable label="Q1 2025 schedule">
  <GanttTableHead>
    <GanttTableTr>
      <GanttTableTH scope="col">Task</GanttTableTH>
      <GanttTableTH scope="col">Jan</GanttTableTH>
      <GanttTableTH scope="col">Feb</GanttTableTH>
      <GanttTableTH scope="col">Mar</GanttTableTH>
    </GanttTableTr>
  </GanttTableHead>
  <GanttTableBody>...</GanttTableBody>
</GanttTable>

Props

  • children: slot (required) -- header rows containing column labels for tasks and time periods
  • ...restProps: Any additional HTML attributes passed to the <thead> element

Keyboard Interactions

None -- this component is a passive container. Keyboard navigation is handled by the parent GanttTable grid.

ARIA

  • Implicit rowgroup role from the <thead> element -- groups the header rows of the grid

When to Use

  • Use inside GanttTable to provide the <thead> header section.
  • Use to label the task-name column and time period columns (e.g., weeks, months, sprints).
  • Use when the Gantt chart needs clearly labelled column headers for accessibility.

When Not to Use

  • Do not use outside of a GanttTable structure -- use TableHead or DataTableHead for general tables.
  • Do not use for body or footer rows -- use GanttTableBody or GanttTableTfoot instead.

Headless

This headless component provides a <thead> element with implicit rowgroup role for grouping header rows within a Gantt chart grid. The consumer provides all visual styling including header background, typography, and column alignment.

Styles

The consumer provides all CSS styling. The component renders with a .gantt-table-thead class for targeting. No default styles are included — this is a fully headless component.

Testing

  • Verify the component renders a <thead> element with class gantt-table-thead
  • Verify pass-through attributes are applied

Advice

  • Designers: Make header labels concise and readable. For long timelines, consider multi-row headers (e.g., months on one row, weeks on another).
  • Developers: Use <th> elements inside GanttTableTr children for proper header cell semantics. Add scope="col" to column headers for screen reader clarity.

Implementation Notes

  • Renders as a <thead> element for the header section of a Gantt chart grid
  • Children should be one or more rows with <th> cells labeling the task column and time-period columns
  • Designed to be used inside a GanttTable <table> structure
  • Spreads restProps onto the <thead> element for consumer customization
  • No internal state -- purely a structural wrapper

Related components

  • gantt-table — a Gantt chart table interactive grid for planning schedule visualization <table>
  • gantt-table-tbody — see components.tsv
  • gantt-table-tfoot — see components.tsv
  • gantt-table-tr — see components.tsv
  • gantt-table-th — a Gantt chart table interactive grid header cell for planning schedule visualization <th>
  • gantt-table-td — a Gantt chart table interactive grid data cell for planning schedule visualization <td>

References

  • WAI-ARIA Grid Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/grid/

Canonical contract

Generated from this component's canonical metadata — the machine-checked source the implementations are held to.

Metadata

  • Component: gantt-table-thead
  • PascalCase: GanttTableThead
  • Description: a Gantt chart table interactive grid thead for planning schedule visualization <thead>
  • Status: beta — implemented and unit-tested in all seven frameworks with an axe-clean demo page; not yet exercised in composed flows
  • HTML tag: <thead>
  • CSS class: .gantt-table-thead
  • Interactive: no

ARIA

  • Implicit rowgroup role from the <thead> element -- groups the header rows of the grid

Keyboard

  • No keyboard interactions — this is a passive element

Props

  • children: slot (required) -- header rows containing column labels for tasks and time periods
  • ...restProps: Any additional HTML attributes passed to the <thead> element