Watermark
A watermark: each unit tile is generated offscreen as a dataURL by canvas and then tiled as a background image over the protected content (pointer-events:none + selection-proof). Two modes — text and image; on H5 a MutationObserver provides tamper-proof self-healing. The tile tiling computation (computeWatermarkTile) and the rendering checks all consume the pure logic in @lh-ui/share/core/watermark.
Basic Usage
Text watermark (multiple lines separated by \\n)
Protected content: drop in images, text or any business block.
The watermark overlays this area without blocking interaction.
vue
<script setup lang="ts">
import { LhWatermark } from '@lh-ui/vue3'
</script>
<template>
<LhWatermark content="lh-ui family" :font-size="16" :gap-x="120">
<div>Protected content</div>
</LhWatermark>
</template>Image watermark and fullscreen
image takes precedence over content; fullscreen covers the viewport (fixed positioning):
vue
<LhWatermark image="/logo.png" :opacity="0.2" fullscreen />API
Watermark Props
| Prop | Description | Type | Default |
|---|---|---|---|
| content | Watermark text (multiple lines separated by \n); takes effect when image is not passed | string | — |
| image | Watermark image URL; takes precedence over content when passed | string | — |
| opacity | Overall opacity (0-1) | number | 0.15 |
| rotate | Unit tile rotation angle | number | -22 |
| gapX | Horizontal gap in px | number | 100 |
| gapY | Vertical gap in px (falls back to gapX when not passed) | number | — |
| fontSize | Text font size in px (falls back to the watermark.fontSize token when not passed) | number | 14 |
| fontColor | Text color (falls back to the color.text.primary token when not passed) | string | — |
| zIndex | Watermark layer z-index (falls back to zIndex.normal when not passed) | number | 100 |
| fullscreen | true covers the full screen; false is absolutely positioned to the nearest positioned parent | boolean | false |
| disabled | Turn off the watermark (the watermark layer is not rendered) | boolean | false |
| sx | sx quick-layout props | LhSxProps | — |
Watermark Slots
| Slot | Description |
|---|---|
| default | Protected content (the watermark overlays it) |
Accessibility
The watermark layer is aria-hidden="true"; the root node has aria-label="Watermark".

