Every node and edge has a set of built-in style properties that control its visual appearance. These properties are set
through the styles system using any
style value type.
Depth layer for label rendering (defaults to related node’s depth)
labelAttachment
string | null
Label attachment name (references primitives.nodes.labelAttachments)
labelAttachmentPlacement
"below" | "above" | "left" | "right"
Attachment position relative to label
labelBackgroundColor
string
Label background fill color (transparent = no background)
labelBackgroundPadding
number
Padding around the label background in pixels
labelCursor
string
CSS cursor to show when hovering the label (requires nodeLabelEvents)
Backdrop properties
Backdrops render a styled GPU shape (fill, border, shadow, corner radius) behind nodes and/or their labels. They are
expensive compared to other node properties and meant for a handful of elements at a time, typically hovered or
highlighted. For a cheap, always-on flat rectangle behind a label only (which also serves as the hit area for label
events), use labelBackgroundColor / labelBackgroundPadding above instead.
Property
Type
Description
backdropVisibility
"visible" | "hidden"
Whether the backdrop is shown
backdropColor
string
Backdrop fill color
backdropShadowColor
string
Shadow color
backdropShadowBlur
number
Shadow blur radius in pixels
backdropPadding
number
Padding around the node and label in pixels
backdropBorderColor
string
Border color
backdropBorderWidth
number
Border width in pixels
backdropCornerRadius
number
Corner radius in pixels
backdropLabelPadding
number
Label-specific padding (-1 falls back to backdropPadding)
backdropArea
"both" | "node" | "label"
Which area the backdrop covers
Edge style properties
Appearance
Property
Type
Description
size
number
Edge thickness in pixels
color
string
Edge color
opacity
number
Opacity from 0 to 1
visibility
"visible" | "hidden"
Whether the edge is visible
path
string
Path type (e.g. "straight", "curved"). Must match a path in primitives.edges.paths
head
string
Head (target) extremity type (e.g. "arrow", "none")
tail
string
Tail (source) extremity type
selfLoopPath
string
Path type override for self-loop edges
parallelPath
string
Path type override for parallel edges
parallelSpread
number
Spread factor for parallel edge separation (default: 0.25)
Interaction
Property
Type
Description
cursor
string
CSS cursor to show when hovering (e.g. "pointer")
Ordering
Property
Type
Description
depth
string
Depth bucket for render ordering
zIndex
number
Continuous sub-order within the bucket (lower paints first)
Position mode, or a ratio along the edge (0 = source, 0.5 = middle, 1 = target)
labelDepth
string
Depth layer for label rendering (defaults to related edge’s depth value)
labelBackgroundColor
string
Label background fill color (transparent = no background)
labelBackgroundPadding
number
Padding around the label background in pixels
labelCursor
string
CSS cursor to show when hovering the label (requires edgeLabelEvents)
Stage style properties
Stage styles apply to the sigma container itself. Unlike node and edge styles, stage styles only support
graph state conditionals (not attribute bindings).
Property
Type
Description
cursor
string
CSS cursor on the stage (fallback when nothing hovered)
background
string
Stage background color
Stage styles support the same rule-level conditionals as nodes/edges, but predicates match against graph state flags
(e.g. isDragging, hasHovered):
const renderer = newSigma(graph, container, {
styles: {
nodes: { cursor: "grab" },
stage: {
whenState: "isDragging",
then: { cursor: "grabbing" },
},
},
});
Custom variables
Additional style properties can be declared via primitives.nodes.variables and primitives.edges.variables. These are
used by custom rendering layers.