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 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 background shape behind nodes and their labels, typically used for hover effects.
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 layer for render ordering
zIndex
number
Z-index within the depth layer
Label properties
Property
Type
Description
label
string
Label text content
labelColor
string
Label text color
labelSize
number
Label font size in pixels
labelFont
string
Label font family
labelVisibility
"auto" | "visible" | "hidden"
Label visibility mode
labelPosition
number | "over" | "above" | "below" | "auto"
Position mode, or a ratio along the edge (0 = source, 0.5 = middle, 1 = target)
labelDepth
string
Depth layer for label rendering (defaults to depth)
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.