Components Data display
Gantt chart
Map project tasks, progress, and milestones onto a shared date axis.
Form & Function
Exhibition build
Usage
Set Title and an optional Subtitle. Provide Groups in display order, each with a Name and a Tasks slice. Each task takes a Title and Start (YYYY-MM-DD). End is inclusive and defaults to Start. Set Progress to a number from 0 to 100, and add an Owner and Description for the disclosure. For a milestone, set Milestone to true and give it a single date. AsOf adds a reporting line when its date falls within the plan. Go derives the range and positions every bar from the dates you supply. Expand a workstream or task with Enter or Space. Scroll horizontally on narrow screens or switch to List for dates and progress in columns. Task details remain available with JavaScript disabled.
Register gantt-chart with Head and pass its properties to Render. Go setup guide
Group longer-term initiatives by quarter with the Roadmap, or record project milestones in a Timeline.
Go usage
err := mono.UI.Render(w, "gantt-chart", mono.Props{
"AsOf": "2027-03-12",
"Groups": []any{
map[string]any{
"Name": "Editorial",
"Tasks": []any{
map[string]any{
"Description": "Agree on the objects, audience, and central question for the exhibition.",
"End": "2027-03-05",
"Owner": "Leah Chen",
"Progress": 100,
"Start": "2027-03-01",
"Title": "Curatorial brief",
},
map[string]any{
"Description": "Write and proof the wall labels alongside the makers' original notes.",
"End": "2027-03-16",
"Owner": "Iris Tan",
"Progress": 65,
"Start": "2027-03-04",
"Title": "Object captions",
},
map[string]any{
"Description": "Release the approved label artwork to the print studio.",
"Milestone": true,
"Owner": "Editorial team",
"Start": "2027-03-17",
"Title": "Print sign-off",
},
},
},
map[string]any{
"Name": "Fabrication",
"Tasks": []any{
map[string]any{
"Description": "Build scale models and check the proportions against the objects.",
"End": "2027-03-11",
"Owner": "Jo Leone",
"Progress": 100,
"Start": "2027-03-02",
"Title": "Display prototypes",
},
map[string]any{
"Description": "Cut, assemble, and finish the display benches before delivery to the gallery.",
"End": "2027-03-19",
"Owner": "Model shop",
"Progress": 40,
"Start": "2027-03-08",
"Title": "Bench production",
},
},
},
map[string]any{
"Name": "Installation",
"Tasks": []any{
map[string]any{
"Description": "Install the objects and labels, then aim the lighting for the final walk-through.",
"End": "2027-03-25",
"Owner": "Studio crew",
"Progress": 0,
"Start": "2027-03-18",
"Title": "Hang and light",
},
map[string]any{
"Description": "Open the exhibition to visitors and invite the makers to introduce their work.",
"Milestone": true,
"Owner": "Gallery team",
"Start": "2027-03-26",
"Title": "Opening night",
},
},
},
},
"Subtitle": "Form & Function",
"Title": "Exhibition build",
})Rendered HTML
<section id="demo-gantt-chart" data-mono="gantt-chart" aria-labelledby="demo-gantt-chart-title">
<header class="mu-gantt-mast">
<div><p class="mu-gantt-kicker">Form & Function</p><h2 id="demo-gantt-chart-title">Exhibition build</h2></div>
<span class="mu-gantt-period"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="5" width="18" height="16" rx="2"/><path d="M7 3v4m10-4v4M3 10h18"/></svg>1–26 Mar 2027</span>
</header>
<div class="mu-gantt-board">
<div class="mu-gantt-toolbar">
<p><strong>Work plan</strong><span>7 items</span></p>
<div class="mu-gantt-switch" data-view-controls role="group" aria-label="Project view" hidden>
<button type="button" data-view="chart" aria-pressed="true"><svg viewBox="0 0 18 18" width="15" height="15" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M2 4h6M5.5 9h6m-2 5H16"/></svg>Chart</button>
<button type="button" data-view="list" aria-pressed="false"><svg viewBox="0 0 18 18" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M6 4h10M6 9h10M6 14h10M2 4h.3m-.3 5h.3m-.3 5h.3"/></svg>List</button>
</div>
</div>
<div class="mu-gantt-viewport" data-gantt-viewport tabindex="0" role="region" aria-label="Project tasks and dates">
<div class="mu-gantt-sheet">
<div class="mu-gantt-guides" aria-hidden="true"><i style="left:0%"></i><i style="left:26.923076923076923%"></i><i style="left:53.84615384615385%"></i><i style="left:80.76923076923077%"></i><i class="mu-gantt-marker" style="left:44.230769230769226%"></i></div>
<div class="mu-gantt-axis" aria-hidden="true">
<span class="mu-gantt-fixed">Task</span>
<div class="mu-gantt-ticks"><span style="left:0%">1 Mar</span><span style="left:26.923076923076923%">8 Mar</span><span style="left:53.84615384615385%">15 Mar</span><span style="left:80.76923076923077%">22 Mar</span></div>
<span class="mu-gantt-list-dates">Scheduled dates</span><span class="mu-gantt-list-status">Progress</span>
</div>
<details class="mu-gantt-group" open>
<summary><span class="mu-gantt-fixed"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 3.5 4.5 4.5L6 12.5"/></svg><strong>Editorial</strong><small>3</small></span></summary>
<details class="mu-gantt-task">
<summary>
<span class="mu-gantt-fixed"><span class="mu-gantt-task-chevron"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 3.5 4.5 4.5L6 12.5"/></svg></span><span class="mu-gantt-task-name">Curatorial brief</span></span>
<span class="mu-gantt-lane" aria-hidden="true">
<span class="mu-gantt-bar" style="left:0%;width:19.230769230769234%" title="1–5 Mar 2027 · 100% complete"><span style="width:100%"></span><b>100%</b></span>
</span>
<span class="mu-gantt-list-dates">1–5 Mar 2027</span>
<span class="mu-gantt-list-status">100%</span>
<span class="mu-gantt-chart-a11y mu-sr-only">1–5 Mar 2027, 100% complete</span>
</summary>
<div class="mu-gantt-detail">
<p class="mu-gantt-detail-meta"><span>1–5 Mar 2027</span><span>5 days</span><span>100% complete</span><span>Leah Chen</span></p>
<p>Agree on the objects, audience, and central question for the exhibition.</p>
</div>
</details>
<details class="mu-gantt-task">
<summary>
<span class="mu-gantt-fixed"><span class="mu-gantt-task-chevron"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 3.5 4.5 4.5L6 12.5"/></svg></span><span class="mu-gantt-task-name">Object captions</span></span>
<span class="mu-gantt-lane" aria-hidden="true">
<span class="mu-gantt-bar" style="left:11.538461538461538%;width:50%" title="4–16 Mar 2027 · 65% complete"><span style="width:65%"></span><b>65%</b></span>
</span>
<span class="mu-gantt-list-dates">4–16 Mar 2027</span>
<span class="mu-gantt-list-status">65%</span>
<span class="mu-gantt-chart-a11y mu-sr-only">4–16 Mar 2027, 65% complete</span>
</summary>
<div class="mu-gantt-detail">
<p class="mu-gantt-detail-meta"><span>4–16 Mar 2027</span><span>13 days</span><span>65% complete</span><span>Iris Tan</span></p>
<p>Write and proof the wall labels alongside the makers' original notes.</p>
</div>
</details>
<details class="mu-gantt-task">
<summary>
<span class="mu-gantt-fixed"><span class="mu-gantt-task-chevron"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 3.5 4.5 4.5L6 12.5"/></svg></span><span class="mu-gantt-task-name">Print sign-off</span></span>
<span class="mu-gantt-lane" aria-hidden="true">
<span class="mu-gantt-diamond" style="left:63.46153846153846%"></span>
</span>
<span class="mu-gantt-list-dates">17 Mar 2027</span>
<span class="mu-gantt-list-status">Milestone</span>
<span class="mu-gantt-chart-a11y mu-sr-only">17 Mar 2027, milestone</span>
</summary>
<div class="mu-gantt-detail">
<p class="mu-gantt-detail-meta"><span>17 Mar 2027</span><span>Milestone</span><span>Editorial team</span></p>
<p>Release the approved label artwork to the print studio.</p>
</div>
</details>
</details>
<details class="mu-gantt-group" open>
<summary><span class="mu-gantt-fixed"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 3.5 4.5 4.5L6 12.5"/></svg><strong>Fabrication</strong><small>2</small></span></summary>
<details class="mu-gantt-task">
<summary>
<span class="mu-gantt-fixed"><span class="mu-gantt-task-chevron"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 3.5 4.5 4.5L6 12.5"/></svg></span><span class="mu-gantt-task-name">Display prototypes</span></span>
<span class="mu-gantt-lane" aria-hidden="true">
<span class="mu-gantt-bar" style="left:3.8461538461538463%;width:38.46153846153847%" title="2–11 Mar 2027 · 100% complete"><span style="width:100%"></span><b>100%</b></span>
</span>
<span class="mu-gantt-list-dates">2–11 Mar 2027</span>
<span class="mu-gantt-list-status">100%</span>
<span class="mu-gantt-chart-a11y mu-sr-only">2–11 Mar 2027, 100% complete</span>
</summary>
<div class="mu-gantt-detail">
<p class="mu-gantt-detail-meta"><span>2–11 Mar 2027</span><span>10 days</span><span>100% complete</span><span>Jo Leone</span></p>
<p>Build scale models and check the proportions against the objects.</p>
</div>
</details>
<details class="mu-gantt-task">
<summary>
<span class="mu-gantt-fixed"><span class="mu-gantt-task-chevron"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 3.5 4.5 4.5L6 12.5"/></svg></span><span class="mu-gantt-task-name">Bench production</span></span>
<span class="mu-gantt-lane" aria-hidden="true">
<span class="mu-gantt-bar" style="left:26.923076923076923%;width:46.15384615384615%" title="8–19 Mar 2027 · 40% complete"><span style="width:40%"></span><b>40%</b></span>
</span>
<span class="mu-gantt-list-dates">8–19 Mar 2027</span>
<span class="mu-gantt-list-status">40%</span>
<span class="mu-gantt-chart-a11y mu-sr-only">8–19 Mar 2027, 40% complete</span>
</summary>
<div class="mu-gantt-detail">
<p class="mu-gantt-detail-meta"><span>8–19 Mar 2027</span><span>12 days</span><span>40% complete</span><span>Model shop</span></p>
<p>Cut, assemble, and finish the display benches before delivery to the gallery.</p>
</div>
</details>
</details>
<details class="mu-gantt-group" open>
<summary><span class="mu-gantt-fixed"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 3.5 4.5 4.5L6 12.5"/></svg><strong>Installation</strong><small>2</small></span></summary>
<details class="mu-gantt-task">
<summary>
<span class="mu-gantt-fixed"><span class="mu-gantt-task-chevron"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 3.5 4.5 4.5L6 12.5"/></svg></span><span class="mu-gantt-task-name">Hang and light</span></span>
<span class="mu-gantt-lane" aria-hidden="true">
<span class="mu-gantt-bar" style="left:65.38461538461539%;width:30.76923076923077%" title="18–25 Mar 2027 · 0% complete"><span style="width:0%"></span><b>0%</b></span>
</span>
<span class="mu-gantt-list-dates">18–25 Mar 2027</span>
<span class="mu-gantt-list-status">0%</span>
<span class="mu-gantt-chart-a11y mu-sr-only">18–25 Mar 2027, 0% complete</span>
</summary>
<div class="mu-gantt-detail">
<p class="mu-gantt-detail-meta"><span>18–25 Mar 2027</span><span>8 days</span><span>0% complete</span><span>Studio crew</span></p>
<p>Install the objects and labels, then aim the lighting for the final walk-through.</p>
</div>
</details>
<details class="mu-gantt-task">
<summary>
<span class="mu-gantt-fixed"><span class="mu-gantt-task-chevron"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 3.5 4.5 4.5L6 12.5"/></svg></span><span class="mu-gantt-task-name">Opening night</span></span>
<span class="mu-gantt-lane" aria-hidden="true">
<span class="mu-gantt-diamond" style="left:98.07692307692307%"></span>
</span>
<span class="mu-gantt-list-dates">26 Mar 2027</span>
<span class="mu-gantt-list-status">Milestone</span>
<span class="mu-gantt-chart-a11y mu-sr-only">26 Mar 2027, milestone</span>
</summary>
<div class="mu-gantt-detail">
<p class="mu-gantt-detail-meta"><span>26 Mar 2027</span><span>Milestone</span><span>Gallery team</span></p>
<p>Open the exhibition to visitors and invite the makers to introduce their work.</p>
</div>
</details>
</details>
</div>
</div>
<div class="mu-gantt-legend" aria-label="Chart legend">
<span><i class="mu-gantt-key-complete"></i>Completed</span><span><i class="mu-gantt-key-remaining"></i>Remaining</span><span><i class="mu-gantt-key-milestone"></i>Milestone</span>
<span class="mu-gantt-asof"><i></i>As of 12 Mar 2027</span>
</div>
</div>
</section>Go template
{{define "gantt-chevron"}}<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 3.5 4.5 4.5L6 12.5"/></svg>{{end}}
{{$chart := ganttChart .}}
<section id="{{.ID}}" data-mono="gantt-chart" aria-labelledby="{{.ID}}-title">
<header class="mu-gantt-mast">
<div>{{with .Subtitle}}<p class="mu-gantt-kicker">{{.}}</p>{{end}}<h2 id="{{.ID}}-title">{{or .Title "Project plan"}}</h2></div>
{{if $chart.TaskCount}}<span class="mu-gantt-period"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="5" width="18" height="16" rx="2"/><path d="M7 3v4m10-4v4M3 10h18"/></svg>{{$chart.Range}}</span>{{end}}
</header>
{{if $chart.TaskCount}}
<div class="mu-gantt-board">
<div class="mu-gantt-toolbar">
<p><strong>Work plan</strong><span>{{$chart.TaskCount}} {{if eq $chart.TaskCount 1}}item{{else}}items{{end}}</span></p>
<div class="mu-gantt-switch" data-view-controls role="group" aria-label="Project view" hidden>
<button type="button" data-view="chart" aria-pressed="true"><svg viewBox="0 0 18 18" width="15" height="15" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M2 4h6M5.5 9h6m-2 5H16"/></svg>Chart</button>
<button type="button" data-view="list" aria-pressed="false"><svg viewBox="0 0 18 18" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M6 4h10M6 9h10M6 14h10M2 4h.3m-.3 5h.3m-.3 5h.3"/></svg>List</button>
</div>
</div>
<div class="mu-gantt-viewport" data-gantt-viewport tabindex="0" role="region" aria-label="Project tasks and dates">
<div class="mu-gantt-sheet">
<div class="mu-gantt-guides" aria-hidden="true">{{range $chart.Ticks}}<i style="left:{{.Offset}}%"></i>{{end}}{{if $chart.AsOf}}<i class="mu-gantt-marker" style="left:{{$chart.AsOfPosition}}%"></i>{{end}}</div>
<div class="mu-gantt-axis" aria-hidden="true">
<span class="mu-gantt-fixed">Task</span>
<div class="mu-gantt-ticks">{{range $chart.Ticks}}<span style="left:{{.Offset}}%">{{.Label}}</span>{{end}}</div>
<span class="mu-gantt-list-dates">Scheduled dates</span><span class="mu-gantt-list-status">Progress</span>
</div>
{{range $chart.Groups}}
<details class="mu-gantt-group" open>
<summary><span class="mu-gantt-fixed">{{template "gantt-chevron"}}<strong>{{or .Name "Tasks"}}</strong><small>{{len .Tasks}}</small></span></summary>
{{range .Tasks}}
<details class="mu-gantt-task">
<summary>
<span class="mu-gantt-fixed"><span class="mu-gantt-task-chevron">{{template "gantt-chevron"}}</span><span class="mu-gantt-task-name">{{.Title}}</span></span>
<span class="mu-gantt-lane" aria-hidden="true">
{{if .Milestone}}<span class="mu-gantt-diamond" style="left:{{.Center}}%"></span>
{{else}}<span class="mu-gantt-bar" style="left:{{.Offset}}%;width:{{.Width}}%" title="{{.Range}} · {{.Progress}}% complete"><span style="width:{{.Progress}}%"></span>{{if ge .Width 8.0}}<b>{{.Progress}}%</b>{{end}}</span>{{end}}
</span>
<span class="mu-gantt-list-dates">{{.Range}}</span>
<span class="mu-gantt-list-status">{{if .Milestone}}Milestone{{else}}{{.Progress}}%{{end}}</span>
<span class="mu-gantt-chart-a11y mu-sr-only">{{.Range}}, {{if .Milestone}}milestone{{else}}{{.Progress}}% complete{{end}}</span>
</summary>
<div class="mu-gantt-detail">
<p class="mu-gantt-detail-meta"><span>{{.Range}}</span>{{if .Milestone}}<span>Milestone</span>{{else}}<span>{{.Days}} {{if eq .Days 1}}day{{else}}days{{end}}</span><span>{{.Progress}}% complete</span>{{end}}{{with .Owner}}<span>{{.}}</span>{{end}}</p>
{{with .Description}}<p>{{.}}</p>{{end}}
</div>
</details>
{{end}}
</details>
{{end}}
</div>
</div>
<div class="mu-gantt-legend" aria-label="Chart legend">
<span><i class="mu-gantt-key-complete"></i>Completed</span><span><i class="mu-gantt-key-remaining"></i>Remaining</span><span><i class="mu-gantt-key-milestone"></i>Milestone</span>
{{with $chart.AsOf}}<span class="mu-gantt-asof"><i></i>As of {{.}}</span>{{end}}
</div>
</div>
{{else}}<p class="mu-gantt-empty">No tasks scheduled.</p>{{end}}
</section>Component CSS
[data-mono="gantt-chart"] {
--gt-ink: #181818; --gt-line: #d2d2d2; --gt-paper: #f7f7f7;
--gt-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
--gt-label: clamp(12rem, 21cqi, 18rem);
width: 100%; min-width: 0; container-type: inline-size; background: var(--gt-paper); color: var(--gt-ink);
padding-bottom: 1px;
}
.mu-gantt-mast, .mu-gantt-board, .mu-gantt-empty { margin-inline: clamp(.9rem, 3.4cqi, 3rem); }
.mu-gantt-mast { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .7rem 1rem; padding-block: clamp(1.25rem, 2.1cqi, 2rem) clamp(1.15rem, 1.85cqi, 1.7rem); }
.mu-gantt-kicker { display: flex; align-items: center; gap: .55rem; margin-bottom: .45rem; font: 650 .66rem/1.45 var(--gt-mono); letter-spacing: .08em; text-transform: uppercase; }
.mu-gantt-kicker::before { content: ""; width: 1.5rem; height: 1px; background: currentColor; }
.mu-gantt-mast h2 { margin: 0; font: 500 clamp(2.5rem, 5.6cqi, 4.5rem)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.065em; overflow-wrap: anywhere; }
.mu-gantt-period { display: inline-flex; align-items: center; gap: .45rem; font: .76rem/1.3 var(--gt-mono); color: #555; }
.mu-gantt-board { overflow: clip; border: 1px solid var(--gt-line); border-radius: .9rem; margin-bottom: clamp(1.1rem, 2.6cqi, 2.5rem); background: #fff; }
.mu-gantt-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .72rem clamp(.8rem, 1.45cqi, 1.3rem); }
.mu-gantt-toolbar p { display: flex; align-items: baseline; gap: .7rem; }
.mu-gantt-toolbar strong { font-size: clamp(1.2rem, 2cqi, 1.55rem); line-height: 1.1; letter-spacing: -.045em; }
.mu-gantt-toolbar p span, .mu-gantt-switch button, .mu-gantt-axis, .mu-gantt-legend { font-size: .73rem; }
.mu-gantt-toolbar p span { color: #555; font-family: var(--gt-mono); }
.mu-gantt-switch { display: inline-flex; align-items: center; gap: .12rem; padding: .18rem; background: #ececec; border: 1px solid var(--gt-line); border-radius: 1.5rem; }
.mu-gantt-switch button { display: inline-flex; align-items: center; gap: .3rem; border: 0; padding: .37rem .72rem; border-radius: 1.2rem; line-height: 1.25; font-weight: 600; background: transparent; color: #505050; }
.mu-gantt-switch button[aria-pressed="true"] { background: var(--gt-ink); color: white; }
.mu-gantt-switch button:hover:not([aria-pressed="true"]) { background: #ddd; }
.mu-gantt-viewport { overflow: auto; scrollbar-width: thin; scrollbar-color: #909090 #eee; }
.mu-gantt-viewport:focus-visible { outline-offset: -3px; }
.mu-gantt-sheet { position: relative; min-width: max(100%, calc(var(--gt-label) + 29rem)); }
.mu-gantt-sheet :where(summary) { list-style: none; cursor: pointer; }
.mu-gantt-sheet :where(summary)::-webkit-details-marker { display: none; }
.mu-gantt-sheet summary:focus-visible { outline-offset: -2px; }
.mu-gantt-fixed { position: sticky; left: 0; z-index: 3; width: var(--gt-label); flex: 0 0 var(--gt-label); display: flex; align-items: center; align-self: stretch; gap: .5rem; padding: .45rem .9rem; border-right: 1px solid var(--gt-line); }
.mu-gantt-axis, .mu-gantt-task > summary { display: flex; align-items: center; }
.mu-gantt-axis { position: relative; color: #fff; background: var(--gt-ink); min-height: 2.3rem; font: 500 .68rem/1.3 var(--gt-mono); }
.mu-gantt-axis .mu-gantt-fixed { border-color: #484848; background: var(--gt-ink); letter-spacing: .06em; text-transform: uppercase; }
.mu-gantt-ticks, .mu-gantt-lane { flex: 1; min-width: 0; position: relative; align-self: stretch; overflow: hidden; }
.mu-gantt-ticks span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; white-space: nowrap; border-left: 1px solid #515151; padding-left: .45rem; }
.mu-gantt-guides { position: absolute; inset: 0 0 0 var(--gt-label); pointer-events: none; }
.mu-gantt-guides i { position: absolute; top: 0; bottom: 0; border-left: 1px solid #dedede; }
.mu-gantt-guides i:first-child { display: none; }
.mu-gantt-guides .mu-gantt-marker { border-left: 1px dashed #858585; }
.mu-gantt-group > summary { position: relative; display: flex; background: #efefef; border-block: 1px solid var(--gt-line); }
.mu-gantt-group > summary > .mu-gantt-fixed { background: #efefef; min-height: 2rem; }
.mu-gantt-group > summary strong { font-size: .78rem; line-height: 1.2; overflow-wrap: anywhere; }
.mu-gantt-group > summary small { margin-left: auto; color: #676767; font: .62rem/1 var(--gt-mono); }
.mu-gantt-group > summary svg, .mu-gantt-task-chevron svg { flex: none; }
.mu-gantt-group[open] > summary svg, .mu-gantt-task[open] > summary .mu-gantt-task-chevron svg { transform: rotate(90deg); }
.mu-gantt-task > summary { position: relative; border-bottom: 1px solid #e3e3e3; min-height: 2.7rem; }
.mu-gantt-task:last-child > summary { border-bottom: 0; }
.mu-gantt-task > summary .mu-gantt-fixed { background: white; font-size: .84rem; font-weight: 560; line-height: 1.28; }
.mu-gantt-task-chevron { display: inline-flex; color: #727272; }
.mu-gantt-task-name { overflow-wrap: anywhere; }
.mu-gantt-task > summary:hover .mu-gantt-fixed, .mu-gantt-task[open] > summary .mu-gantt-fixed { background: #f5f5f5; }
.mu-gantt-lane { min-height: 2.55rem; }
.mu-gantt-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 1.38rem; min-width: 2px; overflow: hidden; isolation: isolate; border-radius: .27rem; box-shadow: inset 0 0 0 1px #8a8a8a; background: repeating-linear-gradient(125deg,#e9e9e9 0 3px,#cecece 3px 4px); }
.mu-gantt-bar > span { position: absolute; inset: 0 auto 0 0; background: #262626; }
.mu-gantt-bar > b { position: absolute; left: .28rem; top: 50%; transform: translateY(-50%); padding: .11rem .31rem; border-radius: .15rem; font: 650 .6rem/1 var(--gt-mono); background: #fff; color: #202020; white-space: nowrap; }
.mu-gantt-diamond { position: absolute; top: 50%; width: .85rem; height: .85rem; border-radius: .1rem; background: #1b1b1b; transform: translate(-50%, -50%) rotate(45deg); }
.mu-gantt-detail { position: relative; background: #f8f8f8; padding: .64rem 1rem .78rem; border-top: 1px solid var(--gt-line); border-bottom: 1px solid var(--gt-line); }
.mu-gantt-detail p { max-width: 55rem; font-size: .82rem; line-height: 1.5; overflow-wrap: anywhere; }
.mu-gantt-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .55rem; margin-bottom: .15rem; }
.mu-gantt-detail-meta span { font: .68rem/1.4 var(--gt-mono); color: #484848; }
.mu-gantt-detail-meta span + span { padding-left: .55rem; border-left: 1px solid #b4b4b4; }
.mu-gantt-list-dates, .mu-gantt-list-status { display: none; }
.mu-gantt-legend { display: flex; align-items: center; gap: .45rem 1.1rem; flex-wrap: wrap; padding: .75rem .9rem; border-top: 1px solid var(--gt-line); color: #505050; font-size: .7rem; }
.mu-gantt-legend > span { display: inline-flex; align-items: center; gap: .4rem; }
.mu-gantt-legend i { display: inline-block; width: .82rem; height: .51rem; border-radius: .08rem; }
.mu-gantt-key-complete { background: #262626; }
.mu-gantt-key-remaining { border: 1px solid #919191; background: repeating-linear-gradient(125deg,#ededed 0 2px,#b8b8b8 2px 3px); }
.mu-gantt-legend .mu-gantt-key-milestone { width: .46rem; height: .46rem; margin-inline: .13rem; transform: rotate(45deg); background: #222; }
.mu-gantt-asof { margin-left: auto; }
.mu-gantt-asof i { width: 0; height: .8rem; border-left: 1px dashed #595959; }
.mu-gantt-empty { padding-block: 1rem; }
[data-display="list"] .mu-gantt-sheet { min-width: 0; }
[data-display="list"] :is(.mu-gantt-ticks,.mu-gantt-lane,.mu-gantt-guides,.mu-gantt-legend,.mu-gantt-chart-a11y) { display: none; }
[data-display="list"] .mu-gantt-axis, [data-display="list"] .mu-gantt-task > summary { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) minmax(4rem,.45fr); }
[data-display="list"] .mu-gantt-fixed { position: static; width: auto; flex: 1; border-right: 0; }
[data-display="list"] :is(.mu-gantt-list-dates,.mu-gantt-list-status) { display: block; padding: .45rem .65rem; }
[data-display="list"] .mu-gantt-task :is(.mu-gantt-list-dates,.mu-gantt-list-status) { font: .73rem/1.3 var(--gt-mono); color: #484848; }
@container (max-width: 36rem) {
[data-gantt-viewport] { --gt-label: 9.2rem; }
.mu-gantt-detail { position: sticky; left: 0; width: calc(100cqi - 2rem); }
.mu-gantt-fixed { padding-inline: .55rem; gap: .28rem; }
.mu-gantt-task > summary .mu-gantt-fixed { font-size: .77rem; }
.mu-gantt-mast { align-items: start; flex-direction: column; }
.mu-gantt-asof { margin-left: 0; }
[data-display="list"] .mu-gantt-task > summary { grid-template-columns: minmax(0,1fr) auto; padding: .35rem .55rem; gap: .1rem 0; }
[data-display="list"] .mu-gantt-task .mu-gantt-fixed { padding: .2rem 0; }
[data-display="list"] .mu-gantt-task .mu-gantt-list-dates { grid-column: 1; padding: 0 0 .15rem 1.15rem; }
[data-display="list"] .mu-gantt-task .mu-gantt-list-status { grid-column: 2; grid-row: 1 / span 2; padding-right: 0; }
[data-display="list"] .mu-gantt-axis { grid-template-columns: 1fr auto; }
[data-display="list"] .mu-gantt-axis .mu-gantt-list-dates { display: none; }
}
@media (forced-colors: active) {
.mu-gantt-bar, .mu-gantt-diamond, .mu-gantt-legend i { outline: 1px solid CanvasText; }
.mu-gantt-bar > span, .mu-gantt-diamond, .mu-gantt-key-complete, .mu-gantt-key-milestone { forced-color-adjust: none; background: CanvasText; }
.mu-gantt-switch button[aria-pressed="true"] { outline: 2px solid Highlight; }
}JavaScript module
export function mount(root) {
const controls = root.querySelector('[data-view-controls]');
if (!controls) return;
const buttons = [...controls.querySelectorAll('[data-view]')];
for (const button of buttons) {
button.addEventListener('click', () => {
root.dataset.display = button.dataset.view;
for (const choice of buttons) {
choice.setAttribute('aria-pressed', String(choice === button));
}
});
}
controls.hidden = false;
}Use the HTML in a static site
Copy the rendered HTML above. Download these assets into the same folder as your page, then add the tags below to its head.
Shared CSS Component CSS Ready-to-use module
<link rel="stylesheet" href="./base.css">
<link rel="stylesheet" href="./gantt-chart.css">
<script type="module" src="./gantt-chart.js"></script>Copy into your project
Run this command from the Mono checkout. Set -out to the component directory in your application.
go run ./cmd/mono-ui add -out ./components gantt-chartExample properties (JSON)
{
"AsOf": "2027-03-12",
"Groups": [
{
"Name": "Editorial",
"Tasks": [
{
"Description": "Agree on the objects, audience, and central question for the exhibition.",
"End": "2027-03-05",
"Owner": "Leah Chen",
"Progress": 100,
"Start": "2027-03-01",
"Title": "Curatorial brief"
},
{
"Description": "Write and proof the wall labels alongside the makers' original notes.",
"End": "2027-03-16",
"Owner": "Iris Tan",
"Progress": 65,
"Start": "2027-03-04",
"Title": "Object captions"
},
{
"Description": "Release the approved label artwork to the print studio.",
"Milestone": true,
"Owner": "Editorial team",
"Start": "2027-03-17",
"Title": "Print sign-off"
}
]
},
{
"Name": "Fabrication",
"Tasks": [
{
"Description": "Build scale models and check the proportions against the objects.",
"End": "2027-03-11",
"Owner": "Jo Leone",
"Progress": 100,
"Start": "2027-03-02",
"Title": "Display prototypes"
},
{
"Description": "Cut, assemble, and finish the display benches before delivery to the gallery.",
"End": "2027-03-19",
"Owner": "Model shop",
"Progress": 40,
"Start": "2027-03-08",
"Title": "Bench production"
}
]
},
{
"Name": "Installation",
"Tasks": [
{
"Description": "Install the objects and labels, then aim the lighting for the final walk-through.",
"End": "2027-03-25",
"Owner": "Studio crew",
"Progress": 0,
"Start": "2027-03-18",
"Title": "Hang and light"
},
{
"Description": "Open the exhibition to visitors and invite the makers to introduce their work.",
"Milestone": true,
"Owner": "Gallery team",
"Start": "2027-03-26",
"Title": "Opening night"
}
]
}
],
"Subtitle": "Form \u0026 Function",
"Title": "Exhibition build"
}