Class diagram

Class diagrams document a type’s attributes, methods, and visibility in a compact, 3-compartment box — the standard UML notation for object-oriented design docs and API references. zombie-mermaid renders all four visibility markers and inheritance/composition relationships.

Source → render

A type's shape, one compartment at a time.

shape.mmd
classDiagram
  class Animal {
    +String name
    +int age
    +eat() void
    +sleep() void
  }
Output
Class diagram, Zombie Mermaid Animal + String name + int age + eat(): void + sleep(): void
About this notation

Where class diagrams come from, and how the syntax works.

Class diagrams are UML’s notation for a type’s shape — its attributes, its methods, and how it relates to every other type in the system — the standard reference for object-oriented design docs and for translating a design straight into code. Mermaid’s syntax marks each member’s visibility with `+` (public), `-` (private), `#` (protected), or `~` (package), and distinguishes relationships like inheritance, composition, aggregation, and plain association, each with its own arrowhead. Classes can carry stereotypes such as `<<Interface>>` or `<<Abstract>>` and be grouped into namespaces for larger diagrams.

Read the full syntax reference in the Mermaid docs →
Every example

Every Class diagram example, on its own page.