Atlas
  • All-in-one
  • Solutions
  • Compare
  • Pricing
PricingGet started
All guides
July 11, 2026·10 min read·mermaid, timeline, diagram as code, tutorial

Mermaid Timeline Diagram Tutorial: Build Chronological Diagrams from Text

The Mermaid timeline diagram turns a list of dates and events into a clean chronological visual. This guide covers the exact syntax, the grouping tricks, and where it fits.

A timeline is one of those diagrams that everyone understands instantly and almost nobody enjoys drawing by hand - the moment you add a new event in the middle, every box after it has to shift. Mermaid's timeline diagram removes that pain entirely: you write the periods and their events as indented text, and the renderer handles the spacing, the alternating placement, and the section coloring for you. Because it is text, inserting an event between two others is a one-line edit rather than a re-layout.

This guide walks through the timeline syntax from the first keyword to the finished chart, with real examples you can paste into the Mermaid editor at /diagram-tools/mermaid-editor to see rendered immediately. Everything runs inside Atlas Diagram Studio at /diagrams, where a Mermaid timeline becomes an editable, styleable diagram rather than a flat picture, and where the AI diagram generator at /diagram-tools/ai-diagram-generator can draft one for you from a plain description of the history you want to show.

The basic timeline syntax

Every timeline begins with the keyword "timeline" on its own line, optionally followed by a "title" line. After that, each time period is a line ending in a colon, and each event under it is written after the colon. The simplest form pairs one period with one event: a line like "2021 : Company founded" places a single event under the label 2021. Mermaid reads the text left of the colon as the time period and the text right of it as the event, then lays the periods out horizontally in the order you wrote them.

A time period is not restricted to a year - it can be any label, such as a quarter, a decade, an age, or a phase name like "Discovery." This flexibility is what makes the timeline useful beyond calendar history: product roadmaps, project phases, and personal biographies all fit the same structure. The renderer never tries to interpret the label as a real date, so you are free to use whatever chronological unit your story needs.

Multiple events and grouping into sections

Real timelines rarely have one event per period, and Mermaid handles multiples cleanly. You can attach several events to the same period either by separating them with additional colons on one line or by adding indented lines beneath the period. Sections group a run of periods under a colored band with a heading, using the "section" keyword, which is what turns a flat list into a diagram that communicates eras or phases at a glance.

The bullets below capture the constructs you will reach for most often. Combine them freely - a section can contain many periods, and each period can carry many events, so a decade of company history compresses into a compact, readable block.

  • Start the diagram with "timeline" and optionally a "title My Roadmap" line directly beneath it.
  • Write a single event as "period : event", for example "2020 : Seed round".
  • Add multiple events on one line by chaining colons: "2020 : Seed round : First hire : Beta launch".
  • Or list events on their own indented lines under the period for readability when they are long.
  • Group periods with "section Growth Phase", and every period until the next "section" falls under it.
  • Each section gets its own color automatically, so eras read as distinct bands without any manual styling.
  • Order matters - periods and sections render left to right in exactly the order you write them.

Styling, wrapping, and readability

Long event text wraps automatically, but you control how much fits by keeping each event concise - a timeline is a summary, not a paragraph store. When an event genuinely needs more words, Mermaid wraps it within the event box, and sections keep the layout balanced by distributing periods evenly. If you want to influence colors beyond the automatic section palette, Mermaid's theming applies, and inside Atlas Diagram Studio you can restyle the rendered result directly without touching the source.

A practical readability tip is to lead each event with the most important word, because timelines are scanned, not read. "Launched" or "Acquired" at the start of an event lands faster than a full sentence. Keep periods evenly spaced conceptually too - if one period has ten events and the next has one, consider splitting the crowded period so the visual weight stays balanced across the timeline.

When to reach for a timeline

The timeline is the right tool whenever the story is fundamentally "things happened in this order over time" and the exact durations do not need to be to scale. Company histories, product roadmaps, project retrospectives, personal résumé visuals, and the phases of a research program all fit naturally. If you need proportional time - where the gap between events should reflect real elapsed duration - a Gantt chart is the better Mermaid diagram, since the timeline spaces periods evenly regardless of the real interval.

Because the source is plain text, a timeline is easy to keep current: as a roadmap evolves, you edit a line instead of redrawing. Draft one quickly by describing your history to the AI diagram generator at /diagram-tools/ai-diagram-generator, then refine the wording in the Mermaid editor at /diagram-tools/mermaid-editor. For the broader language, the Mermaid guide at /guides/mermaid-js-complete-guide covers how timelines sit alongside the dozen other diagram types you can write the same way.

Keep reading

  • Best Diagramming Software in 2026: The Overall Buyer Guide
  • How to Make Diagrams for Confluence
  • How to Make Diagrams for Notion
  • Free PDF tools
  • The all-in-one work OS

FAQ

Questions, answered.

What is the difference between a Mermaid timeline and a Gantt chart?
A timeline places periods evenly regardless of real duration, so it is for showing the order of events, not their length. A Gantt chart plots tasks against a real time axis with proportional bars, so it is for schedules where duration and overlap matter. Use a timeline for histories and roadmaps, and a Gantt for project plans.
How do I put more than one event under the same period?
Chain them with colons on a single line, like "2020 : Seed round : First hire : Beta", or list each event on its own indented line beneath the period. Both produce multiple event boxes under the one period label, and the indented form is easier to read when events are long.
Can timeline periods be something other than years?
Yes. Mermaid never interprets the period label as a real date, so you can use quarters, phase names like "Discovery," decades, ages, or any chronological label. This makes the timeline useful for roadmaps and project phases, not just calendar history.
How do sections change a Mermaid timeline?
The "section" keyword groups all following periods under a colored band with a heading until the next section begins. This turns a flat list into a diagram that communicates distinct eras or phases at a glance, and each section is automatically assigned its own color.

Ready when you are

One workspace, not ten.

Atlas replaces the stack with one platform for tasks, projects, CRM, contracts, e-signature, PDF tools, and analytics. Start free.

Get started freeSee pricing
AtlasWork, planned itself.

The AI-native, all-in-one work platform. Tasks, projects, CRM, contracts, and analytics in one calm workspace.

All systems operational
  • SOC 2 II
  • ISO 27001
  • HIPAA
  • GDPR

Product

  • Overview
  • PDF tools
  • People & HR
  • Integrations
  • Marketplace
  • Pricing

Resources

  • Guides
  • Docs
  • API reference
  • Support
  • Changelog
  • Status

Company

  • About
  • Careers
  • Press
  • Contact

Legal & trust

  • Trust center
  • Security
  • Privacy
  • Terms
  • DPA
  • GDPR
  • SLA
  • Refunds
Atlas, a product by wrxstack.com·© 2026 wrxstack·All rights reserved
PrivacyTermsSecurityStatus