Diagrams / Mermaid Timeline: Syntax & Examples

Mermaid Timeline: Syntax & Examples

Build a Mermaid timeline from periods and events. Edit a rollout example, organize milestones and choose a Gantt chart when durations matter.

When to use Timeline

Use a Mermaid timeline to tell an ordered story through periods and events. It suits release histories, research milestones, and project phases. Keep period labels consistent and include the context needed to understand why each event belongs in the story.

Read the Timeline example

Diagram source

timeline
  title Example product rollout
  January : Customer interviews
          : Define scope
  February : Prototype review
  March : Pilot launch
        : Collect feedback
The example moves from discovery to prototype and launch. Multiple events can share a period. Source order conveys the narrative; visual spacing should not be read as a precise duration scale.

Syntax and interpretation

ConceptHow to apply it
PeriodsUse a consistent scale such as months or named phases. Avoid switching silently from days to years.
EventsChoose milestones that explain a change. Too many minor events hide the turning points.
DurationsA timeline emphasizes order. Use a Gantt chart if overlap, duration, or task dependency is essential.

Common questions

Will the editor automatically sort dates?

Arrange the periods in the source in the intended order. Text labels can be phases rather than machine-readable dates, so explicit ordering is the safest approach.