Skip to content

Cheatsheet ​

Everything on one page. The full rules are in Syntax.

CheatsheetCheatsheetEdit
yuhwa
title: Cheatsheet
direction: right

.svc [blue]
.store [amber, cylinder]

user "Customer" [circle, purple]
group core "Core" {
  api "API" .svc [sub: "Node, 3 pods"]
  worker "Worker" .svc
}
db "Postgres" .store

user -> api: HTTPS
api -> db: SQL
api --> worker: job [flow]
worker ..> db: [dashed]

Statements ​

writemeans
title: Checkoutsetting (direction, theme, curve, legend ...)
api "API Gateway"node with id api and a label
api "API" [color: blue, shape: hexagon]node with props
api "API" [blue, hexagon]same: a bare value names its key
a, b, cseveral nodes
a -> b -> cchain
a, b -> cfan-in (a -> c, b -> c)
a -> b: labeledge label
a -> b: label [dashed]edge label and edge props
a -> b: [dashed]edge props, no label
.svc [blue]define a class
api "API" .svcapply a class
group core "Core" { ... }group, may nest
$brand: #2563eb then [fill: $brand]variable
def svc(id, name) { ... } then svc(api, "API")component
import "./shared.yu"pull in another file
# comment / // commentcomment

Arrows ​

arrowlineheads
->solidend
-->dashedend
..>dottedend
=>thickend
<->, <-->, <=>solid, dashed, thickboth
--, -, .., ==solid, solid, dotted, thicknone
a <- bsame as b -> a

Props you use most ​

proponvalues
colornode, group, edgefill, border and text in one: blue, #e11d48, rgb(…), tomato
shapenoderounded, box, pill, circle, diamond, hexagon, cylinder, document, note, text ...
subnodesecond, smaller line
iconnodean emoji before the label
linknodehttp(s), mailto, # or relative URL; the node becomes clickable
styleedge, sequence messagesolid, dashed, dotted
edge-color, edge-widthsetting, paneldefault ink and width of edges, messages, Gantt arrows
flowedgetrue animates the edge
curveedge, settingsmooth, orthogonal, straight
exit, enteredgetop, right, bottom, left, auto
constraintedgefalse: the edge does not affect layout
below, right-of, ...nodea node id: place this node next to it, without an edge
max-widthsettingpx: wide right/left diagrams wrap into rows
text, font-size, ...node, edge, group, panellabel colour, font, size, font-weight, italic; {size: 18, red | part} styles part of a text

yuhwa guide lists every prop and every allowed value. Tones: slate, gray, red, orange, amber, lime, green, teal, cyan, blue, indigo, purple, pink.

Panels ​

blockdraws
sequence id "Title" { ... }sequence diagram
timeline id "Title" { ... }timeline
chart id "Title" [type: pie] { ... }bar, column, line, pie or donut chart
git id "Title" { ... }git history
gantt id "Title" { ... }gantt chart: tasks, dependencies, milestones
quadrant id "Title" { ... }2x2 matrix with points
mindmap id "Title" { ... }mind map from an indented outline
kanban id "Title" { ... }board of columns and cards
treeview id "Title" { ... }file tree or outline, with icons

Panel bodies hold one statement per line. A line's [props] go before its colon or at its end: EU [green]: 46 and EU: 46 [green] are the same. Where the end is free text (timeline titles, quadrant labels), a bracket at the end counts only when it is a colour, so 2025: Launch [beta] keeps its text. Sequence messages take their props at the end only: a -> b: hi [red]. Every kind has its own page under Diagram types. panels: row|column|grid|wrap arranges them next to the graph. See Combining diagrams.

Common mistakes ​

wrongrightwhy
Web Server -> dbweb "Web Server" -> dba multi-word label needs an id and quotes
a -> b [dashed]a -> b: [dashed]props before the colon style node b
a -> b "calls"a -> b: callsa quoted string after b renames b
A[Label]A "Label"Mermaid syntax
a -->|yes| ba --> b: yesMermaid syntax
subgraph x ... endgroup x "X" { ... }Mermaid syntax
%% note# noteMermaid syntax
pie p { ... }chart p [type: pie] { ... }Mermaid syntax
a -> b [red]: hi (sequence)a -> b: hi [red]message props go at the end
core -> db (group)api -> dbedges connect nodes, not groups
a -> x: [opacity: 0]x [right-of: a]placement needs no invisible edge

Every one of these gets a diagnostic that names the fix. Run yuhwa check file.yu and fix everything it reports.

Released under the MIT License.