Advertisement
❮ Previous: Mermaid ER Diagrams Next: Mermaid Kanban Boards ❯

Mermaid Gantt Charts

Mermaid Gantt Charts (gantt) are bar charts that visualize project schedules, timelines, task durations, and dependencies over time.

Gantt charts show tasks across a project timeline.

They are useful for:


Basic Syntax

gantt
    title Website Launch Plan
    dateFormat YYYY-MM-DD

    section Development
    Coding  :done, 2026-01-01, 10d
    Testing :active, after Coding, 5d

Try this code ❯

Structural Configuration & Core Settings
At the top of the chart, you define global parameters like dates, formats, and axis views.


Sections and Task States

Tasks are organized into logical groups using the section keyword. Every task line follows this format:
Task Name : [Modifiers], [Identifier], [Start Date], [End Date/Duration]

Task State Modifiers
You can apply status flags to color-code tasks automatically:

Task Name : tag, start date, duration

Defining Start & Duration

Tasks can also begin after another task.

Build :after Design, 5d

Sections Example

Use section to group tasks.

Example

gantt
    title Software Release Schedule
    dateFormat YYYY-MM-DD

    section Backend
    Design API :a1, 2026-01-01, 3d
    Build DB   :a2, after a1, 5d

    section Frontend
    UI Mockups  :b1, 2026-01-02, 4d
    Integration :b2, after a2 b1, 4d

Try this code ❯


Status Tags

Common task tags described in the source include:

Example:

gantt
    title Project Plan
    dateFormat YYYY-MM-DD

    section Phase 1
    Design :done, 2024-01-01, 2d
    Build  :active, after Design, 5d
    Test   :crit, after Build, 3d

Try this code ❯


Comprehensive Project Timeline Example

Here is a complete development roadmap split into phases, utilizing milestones, dependencies, critical paths, and weekend exclusions:

Example

gantt
    title Software Development Lifecycle Roadmap
    dateFormat  YYYY-MM-DD
    axisFormat  %b %d
    tickInterval 1w
    excludes    weekends

    section Discovery & Scoping
        Requirements Gathering :done, reqs, 2026-10-05, 7d
        Architecture Blueprint :active, arch, after reqs, 5d
        Project Kickoff        :milestone, after arch, 0d

    section Core Development
        Database Schema Setup  :crit, db, after arch, 4d
        Backend API Coding     :crit, api, after db, 10d
        Frontend UI Assembly   :ui, after arch, 12d

    section Testing & Deployment
        Integration Testing    :active, testing, after api, 5d
        Security Audit         :crit, audit, after testing, 3d
        Production Release     :milestone, after audit, 0d

Try this code ❯


Gantt Links

Tasks can be made clickable.

gantt
    section Milestones
    Launch :milestone, m1, 2026-02-01, 0d
    click m1 href "https://example.com"

Try this code ❯


Compact Layout and Display Tips

❮ Previous: Mermaid ER Diagrams Next: Mermaid Kanban Boards ❯
Advertisement