Add inheritance
- Input
- class PedidoUrgente Pedido <|-- PedidoUrgente
- Expected output
- seta de herança apontando para a classe base
The <|-- arrow represents UML-style inheritance, with the triangle pointing at the superclass.
class diagram online
Mermaid classDiagram syntax follows classic UML notation: classes with attributes and methods in separate compartments, visibility symbols and relationships with multiplicity. This preset already loads a Usuario and Pedido example.
The <|-- arrow represents UML-style inheritance, with the triangle pointing at the superclass.
The <<interface>> annotation before the class name adds a UML stereotype shown at the top of the block.
The filled diamond on the whole's side (Pedido) shows that ItemPedido stops existing if Pedido is removed; aggregation (o--) uses the same diamond, but hollow, for a looser relationship.
Mermaid is an open-source JavaScript library that turns plain text, written in its own Markdown-like syntax, into diagrams rendered as SVG. Instead of manually drawing boxes and arrows in a graphics tool, you describe the diagram's structure in a few lines of text and the library computes the layout and draws the result.
They are not required, but they are the standard way to indicate visibility UML-style; without them, Mermaid still draws the attribute or method, just without the visibility symbol next to it.
Yes, with the <|-- arrow, which follows the UML notation of a hollow triangle pointing from the subclass to the superclass.
They represent the relationship's multiplicity, similar to relational databases: "1" means exactly one, "*" means many, and other notations like "0..1" or "1..*" are also accepted.
Loading the rendering engine...
Your Mermaid code and the rendered diagram stay in your browser, processed by the mermaid.js library. Nothing is sent to any server.