A class, declared with "class"
Drawn

The Mermaid
classDiagram
class Order
class Supplier
The library / Class diagrams
A class is a box that lists its attributes and its methods under its name. Held to the same measure, and to the rows each box lists and what each link ends in.
36 samples: 28 drawn as written, 8 drawn less something. Mermaid’s side is mermaid-cli 12.2.0 as it comes, on white. Merlive’s is 0.6.1 in its own look. What is read of a class diagram.
Drawn

classDiagram
class Order
class Supplier
Drawn

classDiagram
Order --> Supplier
Drawn

classDiagram-v2
class Order
Order --> Supplier
Drawn

---
title: Ordering
---
classDiagram
class Order
Order : +String number
Order : +total()
Drawn

classDiagram
class Order["A purchase order"]
class Line["Order line, with *! signs"]
Order --> Line
Drawn

classDiagram
class `Purchase order!`
class `Order line`
`Purchase order!` --> `Order line`
Drawn

classDiagram
class Order
Order : +String number
Order : +Date placed
Order : +total()
Order: +cancel()
Drawn

classDiagram
class Order{
+String number
+Date placed
+total()
+cancel()
}
Drawn

classDiagram
class Order{
+String number
+total() Money
+cancel() bool
}
Drawn

classDiagram
class Basket~Item~{
int id
List~Item~ items
add(List~Item~ more)
lines() List~Item~
byShelf() List~List~Item~~
}
Basket : -List~string~ notes
Drawn

classDiagram
class Invoice{
+String number
-Money total
#Date due
~Ledger ledger
+pay()
-post()
}
Drawn, less something Abstract and static are said in words at the end of the row, where Mermaid slants or underlines it

classDiagram
class Order{
+String prefix$
+total() Money*
+count()$
+next() int$
+check()*
}
Drawn

classDiagram
Document <|-- Order
Order *-- OrderLine
Warehouse o-- Product
Invoice --> Order
Supplier -- Contact
Order ..> PriceList
Payable <|.. Invoice
Buyer .. Note
Drawn, less something "Is a" is drawn from the parent down to the child, whichever way it was written

classDiagram
Order --|> Document : Inheritance
OrderLine --* Order : Composition
Product --o Warehouse : Aggregation
Invoice --> Order : Association
Supplier -- Contact : Link(Solid)
Order ..> PriceList : Dependency
Invoice ..|> Payable : Realization
Buyer .. Note : Link(Dashed)
Drawn

classDiagram
Document <|-- Order : is a
Order *-- OrderLine : holds
Warehouse o-- Product : stocks
Drawn

classDiagram
Order <|--|> Request
Supplier <--> Buyer
Bundle *--o Product
Drawn, less something A lollipop is drawn as a box of its own, named for the interface and marked «interface», with the circle on its line

classDiagram
class Invoice {
Money total
pay()
}
Payable ()-- Invoice
Order --() Printable
Drawn

classDiagram
Customer "1" --> "*" Order
Order "1" *-- "1..*" OrderLine
Warehouse --> "many" Product : Stocks
Drawn

classDiagram
namespace Buying {
class Order
class OrderLine {
int quantity
Money price
}
}
Order *-- OrderLine
Drawn

classDiagram
namespace Auth["Signing in"] {
class User {
+login()
+logout()
}
}
Drawn

classDiagram
namespace Ordering {
namespace Buying {
class Order {
+raise()
}
}
namespace Paying {
class Invoice {
+pay()
}
}
class Ledger {
+post()
}
}
Ledger --> Order : records
Ledger --> Invoice : records
Drawn

classDiagram
namespace Shop.Ordering.Buying {
class Order {
+raise()
}
}
namespace Shop.Ordering.Paying {
class Invoice {
+pay()
}
}
namespace Shop.Ordering {
class Ledger {
+post()
}
}
Ledger --> Order : records
Ledger --> Invoice : records
Drawn

classDiagram
class Payable <<interface>>
Drawn

classDiagram
class Payable
<<interface>> Payable
Payable : amountDue
Payable : pay()
Drawn

classDiagram
class Payable{
<<interface>>
amountDue
pay()
}
class Status{
<<enumeration>>
DRAFT
SENT
PAID
}
Drawn

classDiagram
%% This whole line is a comment: class Ghost <<interface>>
class Order{
+total()
}
Drawn, less something Drawn top to bottom: boxes of different heights are only placed that way yet

classDiagram
direction RL
class Buyer {
-badge : Badge
}
class Badge{
-id : int
-name : string
}
Buyer "1" --o "1" Badge : carries
Drawn, less something The clicks are left out: a page of Merlive opens no links and runs no code of yours

classDiagram
class Order
class Invoice
class Supplier
class Product
link Order "https://example.com/orders" "Open the order"
click Invoice href "https://example.com/invoices" "Open the invoice"
callback Supplier "showSupplier" "Show the supplier"
click Product call showProduct() "Show the product"
Drawn

classDiagram
class Order{
+total()
}
note for Order "Raised by a buyer\nApproved by a manager"
Drawn

classDiagram
note "From order to invoice"
Order --> Invoice
Drawn, less something Each outline is heavy or broken as written, in the design's own nearest colour; the fill is the design's

classDiagram
class Order
class Invoice
style Order fill:#f9f,stroke:#333,stroke-width:4px
style Invoice fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
Drawn
Mermaid could not draw this: Error: Lexical error on line 7. Unrecognized text.
classDiagram
class Order
class Invoice
class Refund
classDef late fill:#f9f,stroke:#c62828,stroke-width:4px;
classDef held,parked stroke:#888,stroke-dasharray: 4 3;
cssClass "Order" late;
cssClass "Invoice,Refund" held;
Drawn

classDiagram
class Order:::late
class Invoice:::late {
-Money total
-pay()
}
classDef late fill:#f96
Drawn, less something The default class is read past: the look is the design's

classDiagram
class Order:::quiet
class Invoice
classDef default fill:#f96,color:red
classDef quiet color:#99f
Drawn, less something A page's own stylesheet cannot be read from here: the class is of that kind, in the design's plain look

classDiagram
class Order:::styleClass
Drawn

---
title: Orders and what they hold
---
classDiagram
note for Invoice "Sent when the order is delivered<br>Paid within thirty days"
Document <|-- Order
Document <|-- Invoice
Document : +String number
Document : +Date raised
Document: +print()
class Order{
+String buyer
+approve()
+total() Money
}
class Invoice{
-Money amountDue
-pay()
}