Mermaid Gantt Chart Examples
Gantt charts show tasks on a timeline. In Mermaid they are handy for release plans and migration schedules that live next to the code in a README or design doc.
A Gantt chart starts with gantt, a dateFormat, and one or more section blocks. Each task has a name, optional tags and ID, a start, and a duration or end date.
API release plan
Tasks can start on a fixed date or after another task's ID, so the schedule updates when an earlier task gets longer.
Rendering preview…
gantt
title API release plan
dateFormat YYYY-MM-DD
section Build
Implement endpoint :a1, 2026-12-01, 5d
Add tests :a2, after a1, 3d
section Release
QA review :b1, after a2, 2d
Production deploy :b2, after b1, 1dSprint with milestones and critical tasks
The done, active, crit, and milestone tags change how a task is drawn. excludes weekends skips Saturdays and Sundays when computing durations.
Rendering preview…
gantt
title Sprint 14
dateFormat YYYY-MM-DD
axisFormat %b %d
excludes weekends
section Backend
Design API contract :done, api1, 2026-12-01, 2d
Implement endpoints :active, api2, after api1, 4d
section Frontend
Build settings page :fe1, 2026-12-03, 5d
section Release
Code freeze :milestone, m1, 2026-12-10, 0d
Deploy :crit, rel, after m1, 1dDatabase migration with parallel work
Two tasks can start after the same task and run in parallel. The cutover waits for both by listing two IDs after after.
Rendering preview…
gantt
title Database migration
dateFormat YYYY-MM-DD
section Prepare
Audit schema :a1, 2027-01-04, 3d
Write migration plan :a2, after a1, 2d
section Execute
Dual-write period :b1, after a2, 7d
Backfill old data :b2, after a2, 5d
section Cutover
Switch reads :crit, c1, after b1 b2, 1d
Drop old tables :c2, after c1, 2dGantt Chart syntax cheat sheet
| Syntax | Meaning |
|---|---|
dateFormat YYYY-MM-DD | How start dates are written |
axisFormat %b %d | How dates are shown on the axis |
section Name | Group of tasks |
Task :id, 2026-12-01, 3d | Task with an ID, start date, and duration |
Task :after id, 2d | Start after another task |
done, active, crit | Task status tags |
milestone with 0d | Milestone marker |
excludes weekends | Skip weekends when counting days |
Common gantt chart mistakes
- The start date must match
dateFormatexactly.2026-12-1fails when the format isYYYY-MM-DD. - Tags come before the ID:
:crit, deploy, after qa, 1d. - Colons in task names end the name early. Rephrase the name instead.
Gantt Chart FAQ
Can a task depend on more than one task?
Yes. List the IDs separated by spaces:
after b1 b2. The task starts when the last of them ends.How do I show today's date?
Mermaid draws a today marker by default when today falls inside the chart. Use
todayMarker off to hide it.Keep going
- Keeping project docs close to the code
- Open the free Mermaid editor to write your own diagram with live preview.
More Mermaid examples
- Mermaid flowchart examples
- Mermaid sequence diagram examples
- Mermaid er diagram examples
- Mermaid class diagram examples
- Mermaid state diagram examples
- Mermaid pie chart examples
- Mermaid mindmap examples
Last updated 2026-11-28.