Skip to content

KWatermark

Add text or images to pages to protect page content.

Install

bash
pnpm add @ikun-ui/watermark
bash
yarn add @ikun-ui/watermark
bash
npm install @ikun-ui/watermark

Basic usage

Multi-line

Use content to set an array of strings to specify multi-line text watermark content.

Image

Specify the image address via image. To ensure that the image is clearly displayed and not stretched, please set the width and height. It is recommended to use an image with at least twice the width and height to ensure the display effect.

Watermark Props

NameTypeDefaultDescription
widthnumber120The width of the watermark, the default value of content is its own width
heightnumber64The height of the watermark, the default value of content is its own height
rotatenumber-22When the watermark is drawn, the rotation Angle, unit °
zIndexnumber9The z-index of the appended watermark element
imagestring-Image source, it is recommended to export 2x or 3x image, high priority.
contentstring[] | string-Watermark text content.
fontFontFontText style.
gap[number, number][100, 100]The spacing between watermarks.
offset[number, number][gap[0]/2, gap[1]/2]The offset of the watermark from the upper left corner of the container. The default is gap/2.
clsstring''Additional class for component
attrsany{}Additional attributes

Watermark Slots

NameDescription
defaultcontent of the watermark.

MIT Licensed