Mermaid Timeline Syntax & Milestone Examples

A timeline places events on labels you choose. Mermaid keeps the order you write; it does not sort dates or measure the gaps.

Browse timeline examples ↓
Unsaved
Ready
Loading Monaco Editor...
Preview
Styling
All diagram types

Mermaid timeline examples

Copy a complete example or open it in the editor to change the labels and events. These examples use horizontal timelines supported by this editor.

Basic release timeline

Start with timeline, add a title, then put each label before a colon and its event after it.

Basic release timeline: rendered Mermaid timeline
timeline
    title Release milestones
    January : Plan the release
    February : Build the prototype
    March : Launch the beta

Sections and multiple events

Use section to group phases. A line starting with a colon adds another event to the previous label; you can also separate events with colons on one line.

Sections and multiple events: rendered Mermaid timeline
timeline
    title Product launch
    section Prepare
        Week 1 : Interview customers
               : Define the scope
        Week 2 : Build prototype : Review feedback
    section Launch
        Week 3 : Open the beta
        Week 4 : Public release

Text labels and source order

Labels can be words, years, or ranges. Mermaid keeps the order you write: this example shows a future goal before a look back. Reorder the lines yourself for chronological order.

Text labels and source order: rendered Mermaid timeline
timeline
    title Planning notes
    Next year : Expand the product
    Last year : Validate the idea
    Today : Review progress

What is a Timeline Diagram?

A Mermaid timeline is a sequence of labels and events. Each label is text — a month, a year, or a word — followed by a colon and an event. A line that starts with a colon adds another event on the same label. section groups a run of labels into a phase. Spacing does not mean duration, and Mermaid will not reorder 'Next year' to the right of 'Last year'. Use a timeline for milestones and histories. Use a Gantt chart when a bar's length has to mean days of work.

When to use it

Use a timeline for a release story, a company history, or an incident narrative. Use a Gantt chart for a schedule with durations and dependencies. Use a git graph when the events are commits and merges.

Edit this timeline diagram in the live editor, read the Mermaid cheat sheet, or compare it with Gantt Chart, Git Graph and Flowchart.

Common Use Cases

  • •Project milestones - Show key dates and deliverables on a timeline
  • •Company history - Visualize organizational milestones and achievements
  • •Product roadmap - Plan and communicate feature release schedules
  • •Historical events - Create visual history for education or documentation
  • •Incident timeline - Document event sequences for post-mortems

Syntax Quick Reference

ElementSyntaxDescription
StarttimelineDeclare a timeline diagram
Titletitle Timeline TitleTimeline heading
Event2024 : Event descriptionText label followed by an event
Multiple events: Second eventAdditional event under the previous label
Sectionsection Period NameGroup events by period

Syntax tips

  • •The first line is timeline. title names the diagram.
  • •Each time point is Label : Event. The label is text. 2024 and Week 1 and Before are all labels.
  • •A line that is only : Another event attaches a second event to the previous label.
  • •You can also put several events on one line, separated by colons.
  • •section Name colors and groups the following time points. It does not create a date range.

Common mistakes

Expecting Mermaid to sort date labels into chronological order.

Write the labels in the order you want them drawn. The timeline does not parse dates.

Using a timeline to show how long a task took.

Bar length is not duration here. Move that schedule to a Gantt chart.

Forgetting the colon, so the event is part of the label.

Every event needs a colon: March : Launch the beta.

Export Options

Timelines are often shared as images in a roadmap doc. SVG stays sharp, and PDF suits a printable plan. Free PNG exports include a watermark.

Got Mermaid code from ChatGPT? Paste it here to render and export instantly.

Get the Free Mermaid Syntax Cheat Sheet

Free Mermaid Syntax Cheat Sheet

All 21 diagram types in one PDF reference.

Frequently Asked Questions

Ready to create your own timeline diagram?

Open the editor with this example pre-loaded and start customizing.

Timeline Diagram templates

Related Diagram Types

All diagram types