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:
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:
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:
You can also put each extra event on its own line, starting with a colon:
Syntax Cheat Sheet
| Element | Syntax |
|---|---|
| Start a timeline | timeline |
| Title | title Release history |
| Period with one event | 2024 : Launch |
| Several events | 2024 : Launch : Funding |
| Group of periods | section 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
timelineyet; 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.
Lite is free for personal use; Pro is $9.99 one-time. Requires macOS 13.0 or later, Intel and Apple Silicon.