JGuang

WaterMark

WaterMark · Ant Design Mobile

Preview
npm install antd-mobile@5.43.0

WaterMark

Add specific text or patterns to the page.

Install

npm install antd-mobile@5.43.0

antd-mobile is for mobile web, not React Native or Mini Programs. React 19 projects must register createRoot with unstableSetRender at the entry, or imperative APIs such as Toast and Dialog cannot render. Switch dark mode with <html data-prefers-color-scheme="dark">.

Examples come from the official Ant Design Mobile repository (MIT) at the commit published as npm 5.43.0. Presentation helpers such as DemoBlock are JGuang rewrites, not antd-mobile APIs.

Add specific text or patterns to the page.

When to Use

Suitable for preventing information theft.

Demos

WaterMark

Props

NameDescriptionTypeDefault
contentWaterMark text contentstring | string[]-
fontColorWaterMark text colorstringrgba(0, 0, 0, .15)
fontSizeWaterMark text font sizestring | number14
fullPageWhether to cover the whole pagebooleantrue
gapXHorizontal spacing between watermarksnumber24
gapYVertical spacing between watermarksnumber48
heightThe height of the WaterMarknumber64
imageImage source, it is recommended to export 2x or 3x image, give priority to image rendering watermarkstring-
imageHeightImage heightnumber64
imageWidthImage widthnumber120
rotateWhen the watermark is drawn, the angle of rotation, in °number-22
widthThe width of the WaterMarknumber120
zIndexZ-index of the added watermark elementnumber2000

CSS Variables

NameDescriptionDefaultGlobal
--z-indexz-index of the water mark layer2000--adm-water-mark-z-index