Mermaid Requirement Diagram Maker

Write requirement diagrams in Mermaid code and watch them render as you type. Start from the example below, then export PNG or SVG, share a link or embed the diagram.

Updated · Code editor with live preview

Requirement diagram example

Rendering preview…

requirementDiagram
    requirement signup_req {
      id: 1
      text: Visitors can create an account with an email address.
      risk: high
      verifymethod: test
    }

    functionalRequirement email_req {
      id: 1.1
      text: The account email must be verified before first sign in.
      risk: medium
      verifymethod: test
    }

    element signup_form {
      type: simulation
    }

    signup_req - derives -> email_req
    signup_form - satisfies -> signup_req

What is a requirement diagram?

A requirement diagram records what a system must do and links each requirement to the things that satisfy, verify or derive from it. It follows the SysML requirement model, so it suits regulated and safety-critical work where traceability has to be demonstrable. In Mermaid you write one starting with the requirementDiagram keyword.

When to use a requirement diagram

  • Traceability for regulated or safety-critical systems
  • Linking acceptance tests back to requirements
  • Systems engineering documentation
  • Audit evidence that every requirement is verified

How to make a requirement diagram in Mermaid

  1. Step 1

    Open the editor

    Open TryMermaid with the example on this page, or start a new diagram with requirementDiagram on the first line.

  2. Step 2

    Write the requirements

    Declare each requirement in a block with an id, the text of the requirement, its risk and its verifymethod.

  3. Step 3

    Trace the links

    Declare the elements that implement or test them, then link the two with relationships such as satisfies or verifies.

  4. Step 4

    Export or share

    Check the live preview, then export as PNG or SVG or copy a share link.

Requirement diagram syntax cheat sheet

ElementSyntaxWhat it does
StartrequirementDiagramBegins a requirement diagram
Requirementrequirement signup_req { … }A named requirement block
Idid: 1.1Reference number inside a block
Texttext: Users can sign in.What the requirement says
Riskrisk: highlow, medium or high
Verify methodverifymethod: testanalysis, inspection, test or demonstration
Elementelement signup_form { … }Something that implements or tests a requirement
Relationshipsignup_form - satisfies -> signup_reqsatisfies, verifies, derives, refines, traces, contains or copies

Requirement diagram FAQ

What requirement types does Mermaid support?

Mermaid supports requirement, functionalRequirement, interfaceRequirement, performanceRequirement, physicalRequirement and designConstraint. They are drawn the same way; the keyword records what kind of requirement it is.

Which relationships can I draw between requirements?

The relationships are satisfies, verifies, derives, refines, traces, contains and copies. Write them between two names, as in signup_form - satisfies -> signup_req.

What does verifymethod mean?

verifymethod records how the requirement will be shown to be met, and accepts analysis, inspection, test or demonstration. It appears in the box so reviewers can see the plan.