Configuration
One object configures everything: VisualLinkerConfig. It is grouped by what it styles, so a setting is always in the place you would look for it. The same object is accepted by createVisualLinker(), by the config prop of <VisualLinker>, by useVisualLinker(), and by the visualLinker key of the Nuxt module.
const linker = createVisualLinker(el, {
theme: darkTheme,
lines: {
curve: 'smoothstep',
color: '#6fcf97',
width: 2,
hover: { width: 3 },
bezier: { curvature: 0.5 },
smoothstep: { cornerRadius: 8, stub: 20 },
routing: { avoidObstacles: true, padding: 12 },
jumps: { radius: 6 },
animated: { shape: 'dots', speed: 50 },
},
markers: { end: { shape: 'arrow', hover: { size: 10 } }, sizes: { arrow: 8 } },
ports: { show: true, radius: 4, hover: { radius: 6 }, spread: { gap: 16 } },
labels: { background: '#fff', fontSize: 11 },
blocks: { draggable: true, drag: { grid: 20, bounds: 'container', collision: { gap: 16 } } },
interaction: { hover: true, highlight: true, selectable: true, clipToScrollParents: 'pin' },
stacking: { lines: 'under' }, // strokes behind the blocks; ports and markers stay in front
})Every field is optional. A field left out falls through to the built-in value, so an empty config {} is a valid, complete configuration.
Where a value comes from
For any visual setting the first of these that has a value wins:
- The field on the entity itself — a connection's
style, a port, a block, a label. - The matching group of the configuration passed to the engine.
- The shared configuration of the Vue app or Nuxt project, when there is one (see Shared Configuration).
- The theme token.
- A CSS variable that your own stylesheet defines.
- The built-in value.
Configurations from several layers are merged field by field, state by state, not replaced as a whole: setting lines.hover.width in one place and lines.hover.color in another gives a hover state with both.
A connection's style has the same shape as the lines group, plus markers: { start, end } and stacking. Whatever can be set for every line can be set for a single one, in the same words. style.stacking overrides config.stacking.lines; a block's stacking.ports overrides config.stacking.ports.
Lines
The group lines sets the default look and routing of every connection. Its fields:
curve—'bezier' | 'straight' | 'smoothstep'· default:'bezier'. See Connections.endGap—number | { start, end }, px · default:0. The line stops this far before the port.overlap—'stack' | 'offset'· default:'stack'.'offset'moves a line that coincides with another one aside.kinds—Record<string, ConnectionStyle>· default: unset. A style perkindof connection.proxied.start,proxied.end— marker inputs for an end moved onto a fallback block.color—string· default:'#2e8b57', or the theme'sline.width—number· default:1.5.dashed—boolean· default:false.opacity—number,0..1· default:1.highlight,hover,selected,focus— the same fields, applied in that state. See Visual States.animated—boolean | ConnectionFlow· default: off. See Animated Flow.bezier—{ curvature, minReach, maxReach, angleBlend, angleMaxOffset }· the shape ofbeziercurves, see below.smoothstep—{ cornerRadius, maxTrunkReach, stub }· the shape ofsmoothsteplines, see below.routing—{ avoidObstacles, padding }· see Routing and Crossings.jumps—boolean | { radius }· default: off. See Routing and Crossings.
The bezier group, for curve: 'bezier' only:
curvature—number· default:0.5. Control-point reach as a fraction of the distance between the endpoints, before the min/max clamp.minReach—number· default:24. Floor on control-point reach, in px, whatever the distance.maxReach—number· default:160. Ceiling on control-point reach, in px — the main knob for how bowed a long connection gets.angleBlend—number,0..1· default:0.55. How far the exit and entry angle leans toward the other endpoint instead of staying perpendicular to the border;0turns the lean off.angleMaxOffset—number, degrees · default:30. Absolute ceiling on that lean.
The smoothstep group, for curve: 'smoothstep' only:
cornerRadius—number· default:8. Radius of the rounded 90° bends, branch points included.maxTrunkReach—number· default:48. Only for connections that share a port and a side: caps how far their common trunk extends before splitting. Siblings that disagree use the smallest value.stub—number, px · default:20. How far a line keeps going straight out of a block's side before it may turn; also the clearance of a trunk that wraps around blocks and the minimum reach of a shared branch point.0turns on the edge. See Routing and Crossings.
The group routing, for smoothstep only:
avoidObstacles—boolean· default:false.padding—number· default:12. Clearance kept from every other block, in px.
Markers
The group markers sets the markers at the ends of every connection and the default size of each built-in shape.
start,end—false | MarkerShape | MarkerConfig· default: unset, which shows the built-in port dot. A shape name is shorthand for{ shape };falseremoves even the dot, leaving a bare point. A marker configured here replaces the dot at that end of every connection. The marker fields and their states are described in Connection Styling.sizes—{ circle, square, diamond, arrow }· default:6for each. The size of a marker of that shape that sets nosizeof its own, as a multiple of the line's current stroke width.units(inside a marker config) —'stroke' | 'px'· default:'stroke'.'px'makessizepixels instead of a multiple of the line width.
Ports
The group ports sets the built-in dot drawn at every resolved port, and the defaults for ports.
show—boolean | 'connected' | 'all'· default:true. Draws the circle:true/'connected'on connected ports,'all'on every declared port,falsenowhere. The#portslot and thelayoutevent work either way. See Port Display & Roles.radius—number· default:4.fill—string· default:'#ffffff', or the theme'sportFill.stroke—string· default: follows the line color, or the theme'sportStroke.strokeWidth—number· default:1.5.opacity—number,0..1· default:1.highlight,hover,selected,focus— the same fields, in that state of the dot's connection.side—'auto' | FixedSide | FixedSide[]· default:'auto'. The side for every port that sets none of its own.offset—number,0..1· default:0.5. The position along that side for every port that sets none of its own.spread—boolean | { gap, padding }· default: off. See Port Spreading.connect—{ source, candidate, target, invalid }, each with the fields above. The look of a port handle while a connection is being made. See Creating Connections.source,target— the same fields (with states), for ports with thatconnectrole.connected— the same fields, for ports that have at least one connection.render—'svg' | 'dom'· default:'svg'.'dom'leaves drawing the port to your own element.clearance—number | 'auto'· default: unset. Extra distance, in px, between the end of a line and the port;'auto'is the circle's radius plus its outline.fadeEdge—number, px · default:0. A port fades out over this distance towards the visible edge of its scroller.sides—{ source?, target? }· default: unset. The side of a port by role.sync—'marker'· default: unset. The outline of the circle follows the marker of its connection.slotPointerEvents—boolean· default:true.falsemakes#portslot content ignore the pointer.
Labels
The group labels sets the look of every label the library draws itself — those with a text. See Connection Labels.
background—string· default:'#ffffff', or the theme'slabelBackground.border—string· default: follows the line color, or the theme'slabelBorder.color—string· default:'#1c1e2b', or the theme'slabelText.fontSize—number, px · default:11.paddingX,paddingY—number, px · default:6and3.opacity—number,0..1· default:1.highlight,hover,selected,focus— the same fields, in that state of the label's connection.
Blocks
The group blocks sets how blocks can be dragged. See Drag & drop.
draggable—boolean· default:false. A block's owndraggableoverrides it.drag—{ grid, bounds, collision }.grid—number, px · default: unset, free movement. Dragged blocks snap their page position to this grid.bounds—'container' | HTMLElement | DragBoundsInset· default: unset, unconstrained. A block's owndragBoundsoverrides it.collision—boolean | { gap?: number }· default: unset, off. Keeps a dragged block from overlapping the others.trueuses a 16px gap;{ gap }sets it. A block's owncollisionoverrides it. Between two blocks the larger gap wins.
Interaction
The group interaction switches on behavior that goes beyond drawing.
hover—boolean· default:false. The pointer over a line puts it into thehoverstate and shows a pointer cursor. See Visual States.highlight—boolean· default:false. The pointer over a block puts its connections into thehighlightstate. See Visual States.selectable—boolean· default:false. See Selection & Accessibility.clipToScrollParents—boolean | 'pin' | 'hide'· default:'pin'. See Scrolling Containers.connect—ConnectConfig· default: off. Lets the user create connections by dragging, clicking or from the keyboard. See Creating Connections.
Stacking
The group stacking sets whether strokes, ports and markers paint over the blocks or behind them. Each field is 'over' | 'under' · default 'over'.
lines— connector strokes and their flow animation.'under'draws them behind the blocks.ports— the built-in port dots. A block'sstacking.portsoverrides this.markers— endpoint markers. Whenlinesis'under','over'(the default) lifts the markers onto the front overlay so arrows stay visible on top of the cards.
One connection overrides the line plane:
{ id: 'highlight', from, to, style: { stacking: 'over' } }Vanilla createVisualLinker(container) inserts an underlay SVG as the container's first child when anything resolves to 'under'. Pass a dedicated host with linker.setUnderlay(host) when the blocks aren't siblings of that SVG — the Vue component does this: in scope="container" it inserts .vl-layer--under before the slot. 'under' has no effect in scope="page", because that overlay is teleported to <body>.
Performance
The group performance limits the expensive work on big diagrams: cull, maxConnectionsForJumps, maxRoutingNodes and maxObstacleBlocks. See Performance.
Theme
The field theme holds the color tokens — one place for the colors of lines, ports and labels, written to CSS variables. See Themes.
Strings and enums
Fixed choices — a curve type, a marker shape, a port side, a marker's orientation — are written as plain strings:
lines: { curve: 'smoothstep' },
markers: { end: { shape: 'arrow', orient: 'fixed' } },A port's side takes the same strings ('left', 'right', 'top', 'bottom', 'auto'). The package also exports an enum for each choice — VLConnectionCurveEnum, VLMarkerShapeEnum, VLFixedSideEnum and VLOrientEnum — and a member such as VLMarkerShapeEnum.ARROW is accepted wherever its string is, with the same value. Use whichever you prefer: the strings need no import, the enums give you autocompletion by name.
Changing the configuration at runtime
The engine takes a new configuration at any time, and everything is redrawn:
linker.setConfig({ lines: { color: '#e0526c' } }) // merged into the current one
linker.setConfig({ lines: { color: undefined } }) // undefined removes a key
linker.replaceConfig(nextConfig) // replaces everything
const current = linker.getConfig() // a copy of what is in effectsetConfig(patch)deep-merges the patch into the current configuration. A key set toundefinedis removed, so a setting can be unset again.replaceConfig(next)replaces the whole configuration.getConfig()returns a copy; changing it does not change the engine.
Settings that attach listeners follow along: turning blocks.draggable on or off makes blocks draggable or not, and turning interaction.selectable off clears the selection and makes the lines plain graphics again. In Vue, change the config prop or a ref instead — see VisualLinker Component.