Diagrams / Mermaid Gantt Chart: Syntax & Examples
Mermaid Gantt Chart: Syntax & Examples
Explore Mermaid Gantt syntax with task dates, durations and dependencies. Review sections, excluded days and a working project schedule example.
When to use Gantt Chart
Use a Mermaid Gantt chart to communicate planned task dates, durations, and dependencies. Group related tasks into sections and show milestones that matter to the audience. The chart is a schedule description, not a live project management system.
- Start with the example in the editor and identify the elements that answer your question.
- Replace the sample labels and values, previewing after each structural change.
- Review the diagram at its intended reading size, then keep the source and export the format your document accepts.
Read the Gantt Chart example
Diagram source
gantt
title Documentation Launch Plan
dateFormat YYYY-MM-DD
section Plan
Outline examples :done, p1, 2026-05-01, 2d
Review syntax :done, p2, after p1, 1d
section Build
Create diagrams :active, b1, 2026-05-04, 3d
Publish docs :b2, after b1, 1dSyntax and interpretation
| Concept | How to apply it |
|---|---|
| Date format | Declare the input date format and use it consistently across the schedule. |
| Task IDs | Give dependent tasks stable IDs. Labels can change while dependency references remain understandable. |
| Excluded days | Excluding days affects scheduling. Check rendered start and finish dates instead of assuming a three-day task always spans three calendar days. |
Common questions
Can I show a history instead of a plan?
Yes, but a timeline is usually simpler for a sequence of completed milestones. Use Gantt when the duration and overlap of activities are important.