logo

X6

  • Tutorials
  • API
  • Examples
  • Q&A
  • Change Log
  • XFlow
  • Productsantv logo arrow
  • 2.x
  • start
    • Introduction
    • Quick Start
  • component
    • XFlowGraph Canvas
    • Background
    • Grid
    • Clipboard Copy and Paste
    • History Undo Redo
    • Minimap
    • Snapline Alignment Lines
    • Transform
    • Control Controller
  • Hook
    • useGraphInstance
    • useGraphStore
    • useGraphEvent
    • useDnd
    • useClipboard
    • useExport
    • useHistory
    • useKeyboard
  • Store

Background

Previous
XFlowGraph Canvas
Next
Grid

Resource

Ant Design
Galacea Effects
Umi-React Application Framework
Dumi-Component doc generator
ahooks-React Hooks Library

Community

Ant Financial Experience Tech
seeconfSEE Conf-Experience Tech Conference

Help

GitHub
StackOverflow

more productsMore Productions

Ant DesignAnt Design-Enterprise UI design language
yuqueYuque-Knowledge creation and Sharing tool
EggEgg-Enterprise-class Node development framework
kitchenKitchen-Sketch Tool set
GalaceanGalacean-Interactive solution
xtechLiven Experience technology
© Copyright 2025 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

Canvas Background

Basic Usage

Note

The <Background /> component can only be used within the <XFlow /> component to function properly.

After importing the <Background /> component, you can set the canvas background of <XFlowGraph />.

<XFlow>
...
<Background color="#F2F7FA" />
</XFlow>

Background Color

Specify the background color of the canvas using the color property.

Background Image

Add the image property to specify a background image for the canvas.

Background Watermark

Set the repeat property to watermark to apply the background image as a watermark effect. You can use the angle property to control the rotation angle of the watermark.

API

Background

Parameter NameDescriptionTypeDefault Value
imageBackground image URLstring-
colorBackground color, supports all CSS background-color propertiesstring-
sizeBackground image size, supports all CSS background-size propertiesstring-
positionBackground image position, supports all CSS background-position propertiesstringcenter
repeatBackground image repeat method, supports all CSS background-repeat properties as well as built-in properties watermark, flip-x, flip-y, flip-xystringno-repeat
angleWatermark rotation angle, effective only when the repeat property is set to watermarknumber20
opacityBackground image opacitynumber1
qualityBackground image qualitynumber1