Skip to content

Styles

The connector's look — line thickness, color, dash pattern — is controlled by trailing attr=value pairs or fields on ConnectorDef (inside { … } body or doc { connectors: … }).

Attributes at a glance

AttributeTypeDefaultMeaning
widthnumber2Stroke width in px
colorcolortheme secondaryOverrides the line (and label) color
dashstringsolidSVG stroke-dasharray (e.g. "6 3", "1 3")
nodeMargin0–10.6Pullback of the arrow tip from the node center
labelScalenumber1Font-size multiplier for the label
idstringOptional id for Note targets

Dash patterns

conn-styles (SVG, frame 1)

Two ways to get a dashed line:

  • Use a dashed arrow operator (..>, <.., <..>, ...). These apply the default dash "6 3".
  • Set dash= explicitly. The value is a standard SVG stroke-dasharray — pairs of "on off" lengths. "1 3" is a dotted line; "8 2 2 2" gives a dash-dot pattern.

When both forms are used on the same connector, the explicit dash wins.

Colors

Connectors default to theme.secondary. Override per-connector:

gg
a --> b "hot path" color=accent
c --> d "private"  color=#8b5cf6

Theme keywords (primary / secondary / accent / …) and alpha suffixes (accent/60) work here the same way they do on nodes — see Color.

Stroke width & node margin

width changes only the line and arrowhead. nodeMargin nudges the tip back from the node center — raise it when the default arrow overlaps the icon:

gg
user --> api "req" width=3
api  --> db  "write" nodeMargin=0.85
Edit this pageLast updated: