Sketchitor Reference Manual
Complete guide to the Sketchitor diagram language.
Quick Start
Each line of a .sketch file is either a directive, a command, or a comment. Commands describe shapes and connections; directives configure global rendering.
# Lines starting with # are comments.
# Global settings
@seed 42
@roughness 1.2
# A simple flowchart
rectangle id=start x=0 y=-150 width=160 height=60 fillColor="#d5f4e6" strokeColor="#27ae60" label="Start"
diamond id=check x=0 y=0 width=160 height=100 fillColor="#fef9e7" strokeColor="#f39c12" label="OK?"
rectangle id=done x=0 y=150 width=160 height=60 fillColor="#fdedec" strokeColor="#e74c3c" label="Done"
arrow from=start.bottom to=check.top
arrow from=check.bottom to=done.top
Every shape is positioned by its centre using x= and y=. The canvas origin (0, 0) is the centre of the SVG viewport.
Directives
Directives start with @ and set global rendering options for the entire diagram.
| Directive | Type | Default | Description |
|---|---|---|---|
@seed | integer | random | Random seed for reproducible sketchy paths. |
@roughness | 0–5 | 1.0 | Global line wobble. 0 = straight, 3+ = very wobbly. |
@bowing | number | 1.0 | Amount of bowing in lines. |
@theme | string | none | Named colour theme (e.g. neutral-default). |
@background | color | transparent | SVG background colour. |
@grid | true/false or number | false | Show a background dot grid. @grid true uses the default spacing; pass a number for custom spacing (e.g. @grid 40). |
@shadow | true/false | false | Add a drop shadow behind all shapes. Can also be set per shape with shadow=true. |
@multi | true/false | false | Render all shapes with a stacked multi-copy effect. Can also be set per shape with multi=true. |
@seed 123
@roughness 1.5
@bowing 0.8
@background "#f8f9fa"
Canvas Command
Alternatively use the canvas command inline to set the viewport:
canvas width=1200 height=800 background="#ffffff"
| Parameter | Type | Description |
|---|---|---|
width | number | Canvas width in pixels. |
height | number | Canvas height in pixels. |
background | color | Background fill colour. |
Coordinate System
The canvas origin (0, 0) is at the centre of the SVG. Positive x goes right, positive y goes down.
# (-400,-300) ────────── (400,-300)
# │ ↑ │
# │ │ y- │
# │ ←── 0 ──→ │
# │ │ y+ │
# (-400,300) ────────── (400,300)
Use the origin= parameter to change the reference point for x= and y=:
| Value | Meaning |
|---|---|
center (default) | x, y is the shape centre. |
topleft | x, y is the top-left corner. |
top | x, y is the top-centre edge. |
topright | x, y is the top-right corner. |
left, right | Middle of left/right edge. |
bottom, bottomleft, bottomright | Bottom edge / corners. |
Basic Shapes
rectangle (alias: rect)
rectangle id=box x=0 y=0 width=200 height=120 corner=8
fillColor="#e3f2fd" strokeColor="#2196f3" label="My Box"
| Parameter | Type | Default | Description |
|---|---|---|---|
x, y | number | 0 | Position (see origin). |
width | number | 100 | Width in pixels. |
height | number | 60 | Height in pixels. |
corner / cornerRadius | number | 0 | Rounded corner radius. |
| + all common parameters | |||
circle
circle id=c1 x=0 y=0 radius=50 fillColor="#fff3e0" strokeColor="#ff9800"
| Parameter | Type | Default | Description |
|---|---|---|---|
x, y | number | 0 | Centre position. |
radius / r | number | 50 | Radius. Sets both width and height to radius*2. |
width | number | — | Alternative: diameter. |
| + all common parameters | |||
ellipse
ellipse x=0 y=0 width=180 height=90 fillColor="#f3e5f5" strokeColor="#9c27b0"
| Parameter | Type | Default | Description |
|---|---|---|---|
x, y | number | 0 | Centre position. |
width | number | 100 | Horizontal diameter. |
height | number | 60 | Vertical diameter. |
| + all common parameters | |||
Advanced Shapes
All advanced shapes accept the same common parameters (x, y, width, height, id, style, label…) unless noted.
diamond
A rotated square with vertices at the four cardinal edges. Commonly used for decision nodes in flowcharts.
diamond id=d1 x=0 y=0 width=140 height=100 fillColor="#fef9e7" strokeColor="#f39c12" label="Decision?"
hexagon
A regular six-sided polygon. The width and height control the bounding box.
hexagon x=0 y=0 width=120 height=100 fillColor="#e8f5e9" strokeColor="#4caf50"
parallelogram
parallelogram x=0 y=0 width=150 height=70 slant=0.2 fillColor="#e3f2fd" strokeColor="#2196f3"
| Parameter | Type | Default | Description |
|---|---|---|---|
slant | 0–0.5 | 0.2 | Horizontal skew as a fraction of width. |
triangle
Isoceles triangle pointing upward. Tip at top-centre, base at bottom.
triangle x=0 y=0 width=120 height=100 fillColor="#fff8e1" strokeColor="#ffc107"
cylinder
A 3D-style cylinder with elliptical caps. Used for databases and storage.
cylinder id=db x=0 y=0 width=100 height=140 fillColor="#e8eaf6" strokeColor="#5c6bc0" label="Database"
cloud
A bumpy cloud silhouette. Useful for external services, internet, or abstract groups.
cloud x=0 y=0 width=180 height=100 fillColor="#e3f2fd" strokeColor="#2196f3" label="Internet"
page
A rectangle with a folded top-right corner. Represents documents or files.
page x=0 y=0 width=110 height=85 foldSize=0.15 fillColor="#e8f6f3" strokeColor="#27ae60" label="Report.pdf"
| Parameter | Type | Default | Description |
|---|---|---|---|
foldSize | 0–0.5 | 0.15 | Corner fold size as fraction of min(width, height). |
document
A rectangle with a wavy bottom edge, used for documents or reports.
document x=0 y=0 width=140 height=90 fillColor="#fff9c4" strokeColor="#f9a825" label="Contract"
step
A hexagonal chevron/step shape, useful for pipeline or process steps.
step x=0 y=0 width=140 height=75 arrowDepth=0.1 fillColor="#fef5e7" strokeColor="#d35400" label="Build"
| Parameter | Type | Default | Description |
|---|---|---|---|
arrowDepth | 0–0.4 | 0.1 | Notch depth as fraction of width. |
callout
A speech-bubble with a triangular tail pointing from one edge.
callout x=0 y=0 width=130 height=80 tailDirection="bottom" tailLength=0.25
fillColor="#d6eaf8" strokeColor="#2874a6" label="Note!"
| Parameter | Type | Default | Description |
|---|---|---|---|
tailDirection | bottom|top|left|right | bottom | Edge from which the tail protrudes. |
tailLength | 0–0.5 | 0.25 | Tail length as fraction of width/height. |
package
A UML package symbol: rectangle with a small tab on the top-left edge.
package x=0 y=0 width=130 height=85 tabWidth=0.35 fillColor="#f4ecf7" strokeColor="#7d3c98" label="com.example"
| Parameter | Type | Default | Description |
|---|---|---|---|
tabWidth | 0–0.6 | 0.35 | Tab width as fraction of shape width. |
person
A simple stick-figure actor icon (circle head + rectangle body).
person x=0 y=0 width=80 height=120 fillColor="#e3f2fd" strokeColor="#2196f3" label="User"
queue
A horizontal cylinder seen from the side. Used to represent queues, buffers or message brokers in system diagrams.
queue x=0 y=0 width=140 height=70 fillColor="#e0f2f1" strokeColor="#00897b" label="Queue"
stored-data (alias: storeddata)
A rounded tape/storage symbol.
stored-data x=0 y=0 width=130 height=70 fillColor="#e8f5e9" strokeColor="#388e3c" label="Archive"
Connections
arrow / line / connect
arrow renders with an arrowhead at the endpoint. line renders with no arrowhead (unless shapeEnd=arrow). connect is an alias for line.
Using anchor references (preferred):
arrow from=box1.right to=box2.left strokeColor="#666" strokeWidth=2
Using absolute coordinates:
line x1=-200 y1=0 x2=200 y2=0 strokeColor="#333" strokeDash="5,5"
| Parameter | Type | Description |
|---|---|---|
from | anchor-ref | Start point. Format: shapeId or shapeId.anchor. |
to | anchor-ref | End point. Format: shapeId or shapeId.anchor. |
x1, y1 | number | Start coordinates (alternative to from). |
x2, y2 | number | End coordinates (alternative to to). |
shapeEnd | arrow|none | Arrowhead at the end (default for arrow: arrow). |
shapeStart | arrow|none | Arrowhead at the start. |
arrowSize | number | Size hint for the arrowhead. |
label | string | Label drawn at the midpoint. |
labelPosition | center|top|… | Label position relative to midpoint. |
| + all stroke style parameters | ||
Path Shapes
polygon
A closed polygon defined by a list of x,y points.
polygon x=0 y=0 points="0,-50 50,30 -50,30" fillColor="#e3f2fd" strokeColor="#2196f3"
linearpath
An open polyline through a list of points. Not filled.
linearpath points="0,0 50,50 100,0 150,50" strokeColor="#e74c3c" strokeWidth=2
curve
A smooth Catmull-Rom spline through the given points.
curve points="0,0 25,50 50,0 75,50 100,0" strokeColor="#9c27b0" strokeWidth=3
arc
arc x=0 y=0 width=100 height=100 start=0 stop=3.14 closed=false strokeColor="#ff5722"
| Parameter | Description |
|---|---|
start | Start angle in radians (0 = right). |
stop | End angle in radians. Full circle: 6.28. |
closed | true to close the arc with lines to the centre (pie slice). |
path
A raw SVG path data string:
path x=0 y=0 d="M -50,0 Q 0,-80 50,0 T 150,0" strokeColor="#3f51b5"
Text Shape
The text shape is a transparent-border bounding box — no stroke, no fill background — designed for floating rich-text content areas. It accepts full markdown in its label= and exposes the same anchor points and id= references as any other box shape, so arrows and connections can reference it.
text x=0 y=0 width=400 height=200 label="""# My Title
**Bold**, *italic*, and ~~strikethrough~~.
- Item one
- Item two
[Link text](https://example.com)""" size=14
| Parameter | Type | Default | Description |
|---|---|---|---|
x, y | number | 0 | Centre position. |
width | number | 300 | Box width (used for text wrapping & anchors). |
height | number | 200 | Box height (used for anchors). |
label / text | markdown string | — | Content. Parsed as CommonMark markdown. Supports triple-quotes for multi-line. |
font | hand-drawn|arial|monospace|serif | hand-drawn | Base font family. |
size / fontSize | number | 16 | Base font size in pixels. Headings scale from this. |
color | color | #000000 | Text colour. |
textAnchor | middle|start|end | middle | Horizontal alignment of all text blocks. |
wrapWidth | number | 88% of width | Word-wrap threshold in canvas units. |
id | identifier | — | Name for anchor & arrow references. |
origin | string | center | Reference point for x, y. |
Because text is a proper box shape, arrows can connect to it:
text id=note x=200 y=0 width=300 height=150 label="""## Note
Some **important** information here.""" size=14
rectangle id=box x=-100 y=0 width=120 height=60 label="Box"
arrow from=box to=note
See Markdown Labels for all supported markdown syntax.
Markdown Labels
Every label= on every shape is parsed as CommonMark markdown (with the strikethrough extension). Plain text with no markdown syntax renders exactly as before.
Inline formatting
| Syntax | Result | SVG output |
|---|---|---|
**text** | Bold | font-weight="bold" |
*text* | Italic | font-style="italic" |
***text*** | Bold & italic | both attributes |
~~text~~ | Strikethrough | text-decoration="line-through" |
`code` | Inline code | Source Code Pro monospace, 88% size |
[text](url) | Link | blue <a href="url" target="_blank"> with underline |
 inline | Image (alt text) | renders as [alt] in surrounding text |
| Emoji 🎉 🚀 ✨ | Emoji | pass-through Unicode in SVG <text> |
Block elements
| Syntax | Result |
|---|---|
# H1 … ##### H5 | Headings scaled at 2×, 1.6×, 1.35×, 1.15×, 1× the base size=; bold. |
- item or * item | Unordered list — prefixed with •, indented by nesting level. |
1. item | Ordered list — prefixed with N., indented by nesting level. |
| triple-backtick fence | Code block — each line rendered in monospace at 88% base size. |
 alone on a line | Block image — SVG <image href="src"> spanning wrap width. |
--- | Thematic break — dashed horizontal rule. |
| Blank line | Paragraph separator. |
Multi-line label syntax
Use triple-quoted strings to write multi-line markdown. The opening """ must be on the same line as the parameter name.
rectangle x=0 y=0 width=300 height=180 fillColor="#f0f4ff" label="""## Summary
**Bold** and *italic* work everywhere.
- Point one
- Point two
Visit [example.com](https://example.com)""" size=14
Notes
- The entire rendered block is vertically centred around the label's anchor point (shape centre for box shapes, midpoint for lines).
- Text wraps at
wrapWidth=(default: 88% of box width). Styled spans are treated as atomic tokens; breaks occur at word boundaries between spans. - The
font=parameter sets the base font. Inline`code`and fenced code always use the monospace family regardless offont=. - Link colours use a fixed blue (
#3b82f6) regardless of the active theme. - Block images require a publicly accessible URL or a
data:URI.
Anchor Points
Anchor points identify named positions on a shape for use in from=, to=, and arithmetic expressions.
arrow from=box1.right to=box2.left
arrow from=box1.bottomright to=box2.topleft
x=(a.right.x + b.left.x) / 2 # x coordinate of midpoint
| Anchor | Position |
|---|---|
center / middle | Centre of the shape. |
top | Top-centre edge. |
bottom | Bottom-centre edge. |
left | Middle of left edge. |
right | Middle of right edge. |
topleft | Top-left corner. |
topright | Top-right corner. |
bottomleft | Bottom-left corner. |
bottomright | Bottom-right corner. |
start | Alias for left (or line start). |
end | Alias for right (or line end). |
The .x / .y axis extraction form returns a scalar:
rectangle x=ref.right.x+20 y=ref.center.y width=100 height=50
Arithmetic Expressions
Numeric parameters accept arithmetic expressions. Parentheses set precedence. Operators: + - * / %
rectangle x=(a.right.x + b.left.x) / 2 y=a.center.y width=80 height=60
# Align below another shape
circle x=ref.center.x y=ref.bottom.y+60 radius=30
# Unary minus
ellipse x=-200 y=-ref.bottom.y width=100 height=50
Fill Styles
Controlled by fillStyle=. Requires fillColor= to take effect.
| Value | Description |
|---|---|
solid | Flat colour fill. |
hachure | Parallel hatch lines. Control with hachureAngle= and hachureGap=. |
cross-hatch | Two sets of crossing hatch lines. |
zigzag | Zigzag pattern. |
zigzag-line | Zigzag lines only (no fill area). |
dots | Random dot pattern. |
dashed | Dashed fill lines. |
none | No fill (transparent). Default when no fillColor. |
rectangle x=-200 y=0 width=120 height=80 fillColor="#e3f2fd" fillStyle=hachure hachureAngle=45 hachureGap=8
rectangle x=0 y=0 width=120 height=80 fillColor="#fce4ec" fillStyle=cross-hatch fillWeight=1.5
rectangle x=200 y=0 width=120 height=80 fillColor="#e8f5e9" fillStyle=dots
Stroke Styles
| Parameter | Values | Description |
|---|---|---|
strokeStyle | solid|dashed|dotted|longdash | Predefined dash patterns. |
strokeDash | SVG dasharray, e.g. "5,5" | Custom SVG stroke-dasharray overrides strokeStyle. |
strokeWidth | number | Stroke width in pixels. Default 2. |
strokeColor | color | Stroke colour. Default #000000. |
rectangle x=-150 y=0 width=120 height=60 strokeStyle=dashed strokeColor="#2196f3"
rectangle x=0 y=0 width=120 height=60 strokeStyle=dotted strokeColor="#e91e63"
rectangle x=150 y=0 width=120 height=60 strokeDash="10,4,2,4" strokeColor="#4caf50"
Common Parameters
Available on all shapes unless otherwise noted.
| Parameter | Type | Default | Description |
|---|---|---|---|
id | identifier | — | Unique name for this shape. Used in anchor references and from=/to=. |
x | expr | 0 | Horizontal position (see origin). |
y | expr | 0 | Vertical position (see origin). |
width | expr | 100 | Shape width. |
height | expr | 60 | Shape height. |
origin | string | center | Reference point for x, y. See Coordinate System. |
strokeColor | color | #000000 | Outline colour. |
strokeWidth | number | 2 | Outline width. |
strokeStyle | solid|dashed|dotted|longdash | solid | Outline style. |
strokeDash | string | — | Custom SVG dasharray (overrides strokeStyle). |
fillColor | color | — | Fill colour. Omit for no fill. |
fillStyle | string | solid | Fill pattern when using fillColor. |
fillWeight | number | 1.5 | Stroke weight for hachure/zigzag fill lines. |
fillOpacity | 0–1 | 0.9 | Fill opacity. |
hachureAngle | degrees | -41 | Angle of hachure lines. |
hachureGap | number | — | Gap between hachure lines. |
roughness / sketchiness | 0–5 | global | Per-shape roughness override. |
bowing | number | global | Per-shape bowing override. |
label | string | — | Text drawn at the shape centre. Parsed as CommonMark markdown — supports headings, bold, italic, strikethrough, inline code, links, lists, fenced code blocks, and block images. See Markdown Labels. |
font | hand-drawn|arial|monospace|serif | hand-drawn | Label font family. |
size / fontSize | number | 16 | Label font size. |
color | color | #000000 | Label text colour. |
shadow | bool | false | Add a drop shadow behind this shape. Overrides the global @shadow directive. |
shadowOffsetX | number | 6 | Horizontal shadow offset in pixels. |
shadowOffsetY | number | 6 | Vertical shadow offset in pixels. |
shadowColor | color | var(--shadow) | Shadow colour. Accepts hex, rgba(…), or theme:shadow. |
multi | bool | false | Render this shape with a stacked multi-copy effect. Overrides the global @multi directive. |
multiOffsetX | number | 6 | Horizontal offset between stacked copies. |
multiOffsetY | number | 6 | Vertical offset between stacked copies. |
© 2026 Sketchitor — Open Editor