WaterMark

Add specific text or patterns to the page.
Import

When To Use#

  • Use when the page needs to be watermarked to identify the copyright.
  • Suitable for preventing information theft.

Examples

The most basic usage.

expand codeexpand code
      Loading...
    

Use nzContent to set a string array to specify multi-line text watermark content.

expand codeexpand code
      Loading...
    

Specify the image address via nzImage. To ensure that the image is high definition and not stretched, set the width and height, and upload at least twice the width and height of the logo image address.

expand codeexpand code
      Loading...
    

The light-speed iteration of the digital world makes products more complex. However, human consciousness and attention resources are limited. Facing this design contradiction, the pursuit of natural interaction will be the consistent direction of Ant Design.

Natural user cognition: According to cognitive psychology, about 80% of external information is obtained through visual channels. The most important visual elements in the interface design, including layout, colors, illustrations, icons, etc., should fully absorb the laws of nature, thereby reducing the user's cognitive cost and bringing authentic and smooth feelings. In some scenarios, opportunely adding other sensory channels such as hearing, touch can create a richer and more natural product experience.

Natural user behavior: In the interaction with the system, the designer should fully understand the relationship between users, system roles, and task objectives, and also contextually organize system functions and services. At the same time, a series of methods such as behavior analysis, artificial intelligence and sensors could be applied to assist users to make effective decisions and reduce extra operations of users, to save users' mental and physical resources and make human-computer interaction more natural.

示例图片

Preview the watermark effect by configuring custom parameters.

expand codeexpand code
      Loading...
    

API#

nz-water-mark#

PropertyDescriptionTypeDefault
nzContentWatermark text contentstring | string[]-
nzWidthThe width of the watermark, the default value of nzContent is its own widthnumber120
nzHeightThe height of the watermark, the default value of nzContent is its own heightnumber64
nzRotateWhen the watermark is drawn, the rotation Angle, unit °number-22
nzZIndexThe z-index of the appended watermark elementnumber9
nzImageImage source, it is recommended to export 2x or 3x image, high priority (support base64 format)string-
nzFontText styleFontTypeFontType
nzGapThe spacing between watermarks[number, number][100, 100]
nzOffsetThe offset of the watermark from the upper left corner of the container. The default is nzGap/2[number, number][nzGap[0]/2, nzGap[1]/2]

FontType#

PropertyDescriptionTypeDefault
colorfont colorstringrgba(0,0,0,.15)
fontSizefont sizenumber16
fontWeightfont weightnormal | light | weight | numbernormal
fontFamilyfont familystringsans-serif
fontStylefont stylenone | normal | italic | obliquenormal

FAQ#

Handle abnormal image watermarks#

When using an image watermark and the image loads abnormally, you can add nzContent at the same time to prevent the watermark from becoming invalid.

<nz-water-mark
  [nzWidth]="212"
  [nzHeight]="32"
  nzContent="NG Ant Design"
  nzImage="https://img.alicdn.com/imgextra/i3/O1CN01UR3Zkq1va9fnZsZcr_!!6000000006188-55-tps-424-64.svg"
>
  <div style="height: 500px"></div>
</nz-water-mark>