Mermaid Timeline Diagram

Draw timelines in Markdown with a few lines of text

A Mermaid timeline shows events in chronological order — a project history, a release plan or a roadmap. You write one line per period, and Mermaid draws the axis, the labels and the colors. It works anywhere Mermaid renders: GitHub, GitLab, Obsidian, VS Code with a Mermaid extension, and MDViewer.

Basic Timeline Syntax

Start with timeline, add an optional title, then write each period followed by a colon and its event:

Mermaid ```mermaid timeline title History of Markdown 2004 : Markdown created by John Gruber 2014 : CommonMark project announced 2017 : GitHub Flavored Markdown spec published 2024 : AI assistants answer in Markdown ```
Mermaid timeline of Markdown history: 2004, 2014, 2017, 2024

The text before the colon is the period (a year, a date, a version, any label). The text after it is the event. Periods appear in the order you write them; Mermaid does not sort them.

Group Periods into Sections

Use section to group periods — for example quarters or project phases. Every period after a section line belongs to it until the next one:

Mermaid ```mermaid timeline title Product launch plan section Q1 January : Private beta March : Public launch section Q2 April : Mobile app June : Team plan ```
Mermaid timeline grouped into Q1 and Q2 sections

Each section gets its own color, which makes long roadmaps easier to scan.

Several Events in One Period

Add more events to the same period by chaining colons:

Mermaid ```mermaid timeline title Release history v1.0 : Viewer : Table of contents v1.1 : Dark mode : Mermaid diagrams : Quick Look v1.2 : PDF export ```
Mermaid timeline with several events per release

You can also put each extra event on its own line, starting with a colon:

Mermaid ```mermaid timeline v1.1 : Dark mode : Mermaid diagrams : Quick Look ```

Syntax Cheat Sheet

ElementSyntax
Start a timelinetimeline
Titletitle Release history
Period with one event2024 : Launch
Several events2024 : Launch : Funding
Group of periodssection Q1

Tips

  • Keep event text short — long labels wrap and make the boxes tall.
  • Timelines are a newer diagram type. If an older renderer shows the code instead of a diagram, it does not support timeline yet; GitHub and current Mermaid versions do.
  • For tasks with start dates and durations, use a Gantt chart instead — a timeline has no real time scale.

More Mermaid guides: What is Mermaid, flowcharts, sequence diagrams, timelines, Gantt charts, class diagrams, ER diagrams and pie charts. To open .mmd files on a Mac, see how to open Mermaid files.

FAQ

How do I make a timeline in Markdown?

Add a fenced code block with the language mermaid, start it with timeline, then write one line per period: 2024 : Event. Any Markdown viewer that supports Mermaid renders it as a diagram.

Does GitHub render Mermaid timelines?

Yes. GitHub renders Mermaid code blocks in Markdown files, issues and pull requests, including the timeline diagram type.

What is the difference between a Mermaid timeline and a Gantt chart?

A timeline lists events per period without a real time scale. A Gantt chart places tasks on a dated axis with start dates, durations and dependencies.

Can I color a section of a timeline?

Each section gets a different color automatically. Custom colors need a Mermaid theme configuration, which not every renderer allows.

View It with MDViewer

MDViewer renders Mermaid diagrams inside any .md file on your Mac — click a diagram to zoom and pan. Paste an example from this guide into a file and open it, or try it without installing in the free online viewer.

Download MDViewer

Lite is free for personal use; Pro is $9.99 one-time. Requires macOS 13.0 or later, Intel and Apple Silicon.