Language Reference

FractalForm diagrams are plain-text scripts for animated system diagrams. A minimal diagram can be one edge:

client -> api: GET /users
api -> client: 200 OK

Edges and state updates create components automatically. Add declarations, phases, notes, overlays, artifacts, playback directives, and control blocks only when the diagram needs them.

Quick reference

Construct
Minimal form
Examples
# bare declaration component api
# with title component api "API"# title, shape, icon, tags component api "API" shape:hexagon icon:server [backend]More…
# trailing marker opens a body # indented lines render as markdown component api "API": Handles HTTP ingress.
# guide bar marker component api "API": Handles requests. - validates input# brace marker component policy "Policy" } Never trusts metadata.More…
# simple edge api -> db
# with label api -> db: SELECT users# with modifier and color api -> upstream: timeout edge:dropped,#ff4d4fMore…
# expands to adjacent pairs client -> api -> db
# mixed arrow types client -> api --> cache ->> queueMore…
# synchronous ->
# optional --># weak ..># streaming ~># async fire-and-forget ->># bidirectional <->More…
# one-to-many api -> [worker-a, worker-b]
# fan-out with label api -> [worker-a, worker-b]: job# fan-in [service-a, service-b] -> api: resultMore…
# visual boundary group ... end
# display name only group "Backend"# key, name, shape, icon group infra "Infra" shape:rect icon:cloudMore…
# free-floating canvas annotation text title "Request Flow"
# with shape and color text title "Request Flow" shape:rect,solid,xl,#info# markdown body text: **Legend:** public request pathMore…
# component content update api: Processing request
# structured data api: {status: ok}# markdown body api: Handles **requests**More…
# phase: Authentication
# phase: Authentication # Validates credentials and issues a token.# phase: Token refresh # Exchanges a valid refresh token for a new access token.More…
# note: Text
# note pause: Text# auto-dismiss after 3s # note 3s: Text# auto-numbered # note n: TextMore…
# canvas-level message # overlay: Text
# overlay: This is a basic overlay# overlay pause: <icon:clock> Wait for the viewerMore…
# artifact travels with the message api -> user: ... %jwt
# full declaration artifact jwt "JWT Token" icon:key-round# named instance %jwt#adminMore…
# dim a component --dim api
# restore --show api# remove from canvas --hide legacy# ghost outline --outline future-serviceMore…
# clear all state --clear
# clear specific components --clear api, cache# clear an artifact --clear %jwtMore…
# insert a delay --wait 2s
# change step duration --step 750ms# set playback speed --speed 5# reset to default --speedMore…
# enable from 1 --autonumber
# start from 10 --autonumber 10# disable --autonumber offMore…
# loop N times repeat 3 ... end
# counted loop repeat 3# inline detached repeat *repeat heartbeatMore…
# concurrent commands parallel ... end
# fetch from cache and database together parallel api -> cache: read user api -> db: SELECT user endMore…
# reusable block block healthcheck ... end
# invoke @healthcheck# run in background --detach @healthcheck# wait for completion --attach @healthcheckMore…
# set a variable $state: value
# set a field to 0 $state.count: 0# increment $state.count++More…

Syntax families

FamilyFormPurpose
Narration comments# phase:, # note:, # overlay:Visible timeline narration and navigation.
Visual directivesshape:..., icon:..., edge:..., [tags]Typed visual metadata for components, groups, text, edges, and tags.
Playback directives--wait, --step, --speed, --clear, --dim, --show, --hide, --outline, --autonumber, --detach, --attachTimeline, visibility, timing, numbering, and background work control.
Control blocksrepeat, parallel, block, *block, *repeatGroup commands for loops, concurrency, reuse, and detached work.

Components

Declare named topology nodes. Edges and state updates auto-create components, so declarations are only needed for custom labels, shapes, icons, tiers, tags, descriptions, or hierarchy. Examples: Components, Descriptions.

Syntax:

component key "Display Name" shape:shape,tier,modifier icon:name,modifier [tags]
ParameterDescriptionExample
keyRequired identifiercomponent api
"Display Name"Quoted labelcomponent api "API Gateway"
shape:shape,tierShape and visual tiercomponent api shape:hexagon,xl
shape:shape,manyStacked pool/replica renderingcomponent workers shape:hexagon,many
icon:name,badgeIcon with optional badge modecomponent api icon:server,badge
[tags]Comma-separated visual metadatacomponent api [backend, gateway]

Aliases: c.

Shapes: default, circle, database, hexagon, diamond, note, actor, icon, cloud, browser, server, funnel, code.

Tiers: xl, lg, md (default), sm, xs.

# full declaration
component api "API Gateway" shape:hexagon,xl icon:server,badge [backend, gateway]
component db "PostgreSQL" shape:database,lg icon:postgresql,badge [storage]

# pools and replicas
component workers "Workers" shape:hexagon,many
component replicas "Read Replicas" shape:database,lg,many

# tier-only (default shape)
component important "Important" shape:lg

Descriptions

Add a trailing :, |, ], or } and indented markdown for permanent descriptions. Descriptions render beside the node and are not cleared by --clear.

MarkerStyle
: or |Guide bar
]Bracket
}Brace
# guide bar (: marker)
component api "API Gateway" shape:hexagon,xl:
  Handles public HTTP ingress and authentication.

# bracket (] marker)
component policy "Policy" ]
  Never trusts tenant-provided ownership metadata.

# brace (} marker)
component worker "Worker" }
  - uses tools
  - runs in a loop

Key hierarchy

Dots create child components inside a parent. Double dots create related components that render separately but stay visually attached. Examples: Member, Related.

# child components
component app "App"
component app.cpu "CPU"
component app.mem "Memory"

# related (renders separately, visually attached)
component app "App"
component app..logs "App Logs"
app -> app..logs: write logs

Edges

Define connections between components. Edges auto-create undeclared components. Examples: Edges, Arrow styles, Chained edges, Fan-out & Fan-in, Bidirectional edges.

Syntax:

source -> target: label
ArrowMeaning
->Synchronous call
-->Optional or conditional
..>Inferred or weak
~>Streaming
->>Async fire-and-forget
-->>Async optional
..>>Async weak
<->Bidirectional
<-->Bidirectional optional
<..>Bidirectional weak
<~>Bidirectional streaming
# labeled edge
api -> db: SELECT users

# chained edges
client -> api -> db

# mixed arrow types
client -> api --> cache ->> queue

# fan-out
api -> [worker-a, worker-b, worker-c]: dispatch job

# fan-in
[service-a, service-b] -> aggregator: results

# bidirectional
client <-> server: WebSocket message

Edge modifiers

Inline modifiers control edge appearance. Example: Edge Icons & Modifiers.

ModifierEffectExample
<icon:name>Icon on the edgeapi -> db <icon:zap>: fast query
<icon:name #color>Colored icondb -> api: rows <icon:check #success>
edge:droppedParticle drops at midpointapi -> upstream: timeout edge:dropped,#error
edge:#colorColors the edgeapi -> db: degraded edge:#warning
api -> db <icon:zap>: fast query
db -> api: rows <icon:check #success>
api -> upstream: timeout edge:dropped,#error
api -> db: degraded edge:#warning

Icons and colors

Icons support Lucide, brand, and AWS icon names with optional color and size. Declarations use bare icon:name; inline narration uses <icon:name #color size>.

ParameterValues
Sizesxs, sm, md, lg, xl
Semantic colors#success, #error, #warning, #info
Palette colors#red, #blue, #green, #yellow, #purple, #gray, #orange, #pink, #cyan, #primary, #secondary
Hex colors#rgb, #rrggbb, #rrggbbaa
# in edge labels
api -> db: query <icon:database #info>
api -> client: failed <icon:x #error xl>

# in overlays
# overlay: <icon:clock #warning> Token expires

# in declarations
group aws icon:cloud,#info
component api icon:server,badge

Tags

Visual metadata on components. Tags do not change behavior. Use them for role, ownership, environment, or status. Optionally colored.

Syntax:

component key [tag1, tag2 #color]
component api "API" [backend, gateway]
component payments "Stripe" [external, payments #info]
component legacy "Legacy API" [deprecated #warning]

Text

Canvas-level annotation (titles, labels, legends, callouts). Not topology. Example: Text.

Syntax:

text id "Display Text" shape:shape,stroke,tier,color
ParameterDescriptionExample
idOptional identifiertext title "Request Flow"
"Display Text"Quoted labeltext title "Request Flow"
shape:shape,modifiersShape, stroke, tier, colortext title "Title" shape:rect,solid,xl,#info
Markdown bodytext: followed by indented linesSee below

Aliases: t.

Shapes: rect (default), circle, diamond, hex, ellipse. Stroke modifiers: solid, dashed, dotted.

# inline text
text title "Request Flow" shape:rect,solid,xl,#info
text subtitle "One request through the backend"

# with markdown body
text warning "Dotted ellipse" shape:ellipse,dotted,#warning:
  Text bodies support **Markdown**.
  - headings
  - lists
  - inline `code`

# inside a group
group annotation-zone shape:rect,dashed,#blue
  text:
    Group-level annotation.
  title
end

State

Set content on a component node. Examples: State, Structured Data, Markdown.

Syntax:

component: content
FormDescriptionExample
TextPlain text stateapi: Processing request
LiteralBacktick-wrapped raw stringSee below
StructuredCurly brace objectapi: {status: ok, count: 42}
Markdown bodyIndented lines after key:See below
Code blockTriple backticks with optional langSee below
Adornmentnode:destroyed modifiersession: <icon:trash-2> destroyed node:destroyed

Common structured data shapes (see Content formats):

ShapeStructure
Headline{text: "Processing"}
Key-value rows{status: ok, queue_depth: 12}
Bullet list{tasks: ["one", "two"]}
Key/value entries{headers: [[Content-Type, application/json]]}
Metrics{metrics: [{name: latency, value: 42, unit: ms}]}
Table{users: [{name: alice, role: admin, active: true}]}
Error panel{error: {code: 404, message: "Not found"}}
Collapsible section{cache: {hits: 12, misses: 3}}
# text state
api: Processing request

# structured data
api: {
  status: "ok",
  count: 42
}

# markdown body
api:
  Handles **requests**.
  - validates input
  - emits events
# code block with language
api: ```json
{
  "status": "ok",
  "data": [1, 2, 3]
}
```

Phases

Label sections of the timeline for navigation. Example: Phases.

Syntax:

# phase: title # description line
FeatureSyntax
Phase header# phase: Authentication
DescriptionComment lines immediately after the phase
# phase: Authentication
# Validates credentials and issues a token.
client -> auth: POST /login

Groups

Draw visual boundaries around components and canvas text. Examples: Groups, Nested Groups.

Syntax:

group key "Display Name" shape:shape,modifiers icon:name,color members end
ParameterDescriptionExample
keyAddressable identifiergroup infra
"Display Name"Quoted labelgroup "Backend"
Key and nameBoth togethergroup infra "Infrastructure"
shape:shape,modifiersShape, stroke, tier, colorgroup infra shape:rect,dashed,#blue
icon:name,colorIcon with optional colorgroup infra icon:cloud,#info

Aliases: g, box, b.

Shapes: rect (default), circle, diamond, hex, ellipse. Inside group bodies, the component keyword is optional.

# named group with members
group "Backend"
  api "API" shape:hexagon
  db "Database" shape:database
end

# with icon
group contact-center icon:aws-connect,#info
  text:
    Owned by support operations.
  api
end

# styled, no members yet
group agents shape:solid

Notes

Attach explanation to the next timeline command. Examples: Notes, Numbered notes.

Syntax:

# note pause number duration: text
ModifierEffectExample
(none)Basic note# note: Text
pauseManual advance required# note pause: Read this first.
3sAuto-dismiss after duration# note 3s: Stripe responds after fraud checks.
1Explicit action number# note 1: User makes request
nNext auto-number# note n: Server validates input
CombinedAny order# note pause n 5s: Inspect the retry
# basic note
# note: Redis avoids a full Postgres round-trip here.
api -> cache: GET session

# timed note
# note 3s: Stripe responds after fraud checks.
api -> payments: charge card

# manual advance
# note pause: Read this before the next step.
api -> db: SELECT users

Overlays

Canvas-level messages for scenario transitions, time skips, or major status changes. Example: Overlays.

Syntax:

# overlay pause: text
FeatureSyntax
Basic# overlay: 5 hours later
With pause# overlay pause: Database unreachable
With icon# overlay: <icon:clock> 5 hours later
With icon and color# overlay: <icon:alert-triangle #warning> Database unreachable
DescriptionComment lines immediately after the overlay
# overlay: <icon:clock> 5 hours later
# overlay pause: <icon:alert-triangle #warning> Database unreachable

Comments

Plain # comments do not render. Special forms # phase:, # note:, and # overlay: create visible timeline content.

# This is a source comment.
# It does not render by itself.

Artifacts

Data objects with identity that travel between components. Declarations are optional; using %key in an edge label creates the artifact automatically. Example: Artifacts.

Syntax:

artifact key "Display Name" icon:name
FeatureSyntaxExample
Declarationartifact key "Name"artifact jwt "JWT Token" icon:key-round
Attach to edge%key in labeluser -> api: GET /profile %jwt
Instance%key#id%order#123
Set state%key: { ... }%jwt: {sub: "user123", exp: 3600}
Clear--clear %key--clear %jwt
# declare and use
artifact jwt "JWT Token" icon:key-round
auth -> user: issue %jwt
%jwt: {sub: "user123", exp: 3600}
user -> api: GET /profile %jwt

# instances
%order#123: {status: "paid"}
%order#456: {status: "pending"}
api -> queue: publish %order#123

Playback directives

Clear

Reset component state, artifact state, or everything. Example: Clear.

FormEffect
--clearClear all component state
--clear api, cacheClear specific components
--clear %jwtClear an artifact
--clear
--clear api, cache
--clear %jwt

Visibility

Control component visibility. Example: Visibility.

FormEffect
--dim targetsDim components
--show targetsRestore full visibility
--hide targetsRemove from canvas
--outline targetsGhost outline
--dimDim all (no targets)
--showShow all (no targets)
--dim cache
--show cache
--hide legacy
--outline future-service

# apply to all
--dim
--show

Timing

Control playback speed and delays. Example: Timing controls.

FormEffect
--wait durationInsert a delay
--step durationChange default step duration
--stepReset step to default
--speed multiplierSet playback speed
--speedReset speed to default
--wait 500ms
--wait 2s
--step 750ms
--speed 5
--speed

Autonumber

Add sequential action badges to sends, receives, and state updates. Example: Autonumbering.

FormEffect
--autonumberEnable from 1
--autonumber 10Start from 10
--autonumber offDisable
--autonumber
--autonumber 10
--autonumber off

Detach and attach

Run blocks in the background. Example: Blocks.

FormEffect
--detach @blockStart block in background
--attach @blockWait for background block
--detach @healthcheck
api -> db: query
--attach @healthcheck

Control blocks

Repeat

Loop a set of commands. Example: Repeat & Speed.

FormEffect
repeat n ... endLoop N times
*repeat name ... endInline detached repeat (runs until attached or timeline ends)
repeat 3
  client -> api: retry
  api -> client: 503
end

*repeat heartbeat
  monitor -> api: GET /health
end

Parallel

Run commands concurrently. Example: Parallel.

parallel
  api -> db: write record
  api -> cache: invalidate
  api -> logger: audit entry
end

Blocks

Reusable named command groups. Invoked with @name. Example: Blocks.

FormEffect
block name ... endDefine a reusable block
@nameInvoke a block
*block name ... endInline detached block (starts immediately)
block healthcheck
  api -> db: SELECT 1
  db -> api: OK
end

@healthcheck

*block poll
  monitor -> api: GET /health
end

Variables

Hold structured state that can be updated and rendered on components. Example: References.

FormEffect
$name: valueSet a variable
$name.field: valueSet a field
$name.field++Increment
$name.field--Decrement
component: $nameRender variable as component state
$state: {
  text: "CLOSED",
  failures: 0
}
breaker: $state
$state.failures++
$state.text: "OPEN"
breaker: $state

Full examples

For larger diagrams, use the built-in examples from the editor dropdown: