Skip to main content

Types

The object types accepted by <ArcherElement> and <ArcherContainer>.

Relation

A single arrow originating from an ArcherElement, passed in its relations array.

PropTypeDefaultDescription
targetIdstringId of the <ArcherElement> this arrow points to.
targetAnchorAnchor'auto'Edge of the target the arrow ends on.
sourceAnchorAnchor'auto'Edge of the source the arrow leaves from.
labelReactNodeRendered at the middle of the arrow.
styleLineStyleinherits containerPer‑arrow style overrides.
ordernumber0Drawing order; a higher value draws on top of others.
classNamestringClass applied to the SVG path.
domAttributesDOMAttributes<SVGElement>DOM attributes on the SVG path (e.g. onClick, onMouseEnter) — makes the arrow selectable.
cursorProperty.CursorHover cursor for the arrow. Requires domAttributes.
hitSlopnumberWidens the clickable/hover area, in px. Requires domAttributes.

Line styling

The shape of a relation's style, and also the set of styling props on <ArcherContainer>. For any given arrow the value is resolved as:

relation stylecontainer propbuilt‑in default

so a container sets the defaults and each relation overrides them as needed.

FieldTypeDefaultDescription
strokeColorstring'#f00'Arrow color.
strokeWidthnumber2Arrow thickness, in px.
strokeDasharraystringDash pattern, e.g. '5,5'.
lineStyle'angle' | 'straight' | 'curve''curve'How the line is drawn.
noCurvesbooleanfalseDraw angles instead of curves (lineStyle takes precedence).
startMarkerbooleanfalseMarker at the start of the arrow.
endMarkerbooleantrueMarker at the end of the arrow.
endShapeEndShapearrowShape drawn at the end.

End shape

endShape is an object whose present key selects the shape — the default is a triangular arrow; provide circle to draw a circle instead.

// arrow (default)
endShape={{ arrow: { arrowLength: 10, arrowThickness: 6 } }}

// circle
endShape={{ circle: { radius: 6, fillColor: '#f472b6', strokeColor: '#be185d', strokeWidth: 3 } }}

arrow:

FieldTypeDefaultDescription
arrowLengthnumber10Length of the arrow head, in px.
arrowThicknessnumber6Width of the arrow head, in px.

circle:

FieldTypeDefaultDescription
radiusnumber2Circle radius, in px.
fillColorstring'#f00'Fill color.
strokeColorstring'#0ff'Border color.
strokeWidthnumber1Border thickness, in px.

Anchors

targetAnchor and sourceAnchor accept:

'top' | 'bottom' | 'left' | 'right' | 'middle' | 'auto'

auto

The default. The facing edge is chosen automatically from the live positions of the two elements.

middle

The middle anchor doesn't look great: the curve isn't smooth and the marker is slightly offset. This is a known, long‑standing limitation.