Installation
Usage
Props
Unique identifier for the background pattern. Useful when multiple Vue Flow instances exist on the same page.
The background pattern variant to display.
dots- Renders a dot patternlines- Renders a line grid pattern
Spacing between pattern elements. Can be a single number for uniform spacing or a tuple
[x, y] for different horizontal and vertical spacing.Size of the pattern elements (dot radius for dots variant).
Width of the lines when using the
lines variant.Color of the background pattern. Accepts any valid CSS color value.
This replaces the deprecated
patternColor prop.Deprecated - Use
color instead. Will be removed in the next major version.Deprecated - Assign background color directly to VueFlow component instead. Will be removed in the next major version.
Offset for the pattern position. Can be a single number or a tuple
[x, y].X-coordinate offset for the background.
Y-coordinate offset for the background.
Deprecated property.
Deprecated property.
Slots
pattern
Custom slot to override the default pattern rendering. Receives the pattern context.
pattern-container
Custom slot to override the entire pattern container, including the SVG pattern definition.
default
Default slot that receives the
patternId for custom rendering.Examples
Dots Pattern
Lines Pattern
Custom Gap
TypeScript
Exports
Background- The main Background componentBackgroundVariant- Enum for background variant types (deprecated, use string literals instead)BackgroundProps- TypeScript interface for component props