npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wecode-team/watermark

v0.0.1

Published

We0 页面水印组件 —— 支持自定义文字内容、重复平铺和样式配置

Readme

@wecode-team/watermark

We0 页面水印组件,支持自定义文字内容、重复平铺、旋转、透明度、字号、颜色和间距配置,适用于后台管理、预览页、演示页等场景。

安装

npm install @wecode-team/watermark
# 或
pnpm add @wecode-team/watermark
# 或
yarn add @wecode-team/watermark

需要 React >= 18 作为 peerDependency。

快速开始

import { We0Watermark } from "@wecode-team/watermark"

export default function Page() {
  return (
    <We0Watermark content="WE0 INTERNAL">
      <main style={{ minHeight: 400, padding: 24 }}>
        页面内容
      </main>
    </We0Watermark>
  )
}

多行内容

<We0Watermark
  content={["WE0", "Confidential"]}
  rotate={-18}
  opacity={0.1}
>
  <section>敏感内容区域</section>
</We0Watermark>

自定义样式

<We0Watermark
  content="Demo Preview"
  fontSize={18}
  color="#1f2937"
  opacity={0.12}
  gapX={120}
  gapY={96}
  width={200}
  height={120}
  zIndex={2}
>
  <div>页面内容</div>
</We0Watermark>

API

<We0Watermark />

| 参数 | 类型 | 默认值 | 说明 | |------|------|--------|------| | content | string \| string[] | - | 水印内容,支持单行或多行 | | width | number | 160 | 单个水印绘制区域宽度 | | height | number | 96 | 单个水印绘制区域高度 | | gapX | number | 80 | 水印横向间距 | | gapY | number | 80 | 水印纵向间距 | | rotate | number | -22 | 水印旋转角度 | | opacity | number | 0.14 | 水印透明度 | | fontSize | number | 16 | 字号 | | lineHeight | number | 1.4 | 多行文字行高倍数 | | color | string | "#000000" | 水印颜色 | | fontFamily | string | "sans-serif" | 字体族 | | fontWeight | CSSProperties["fontWeight"] | 500 | 字重 | | zIndex | number | 1 | 水印层级 | | enabled | boolean | true | 是否启用水印 | | className | string | - | 外层容器类名 | | style | CSSProperties | - | 外层容器样式 | | children | ReactNode | - | 被包裹的页面内容 |

说明

  • 水印层默认 pointer-events: none,不会阻挡页面交互
  • 组件通过 Canvas 生成背景图并重复平铺
  • 在 SSR 场景下会先渲染内容,客户端挂载后补上水印背景
  • React DevTools 中的组件展示名称为 We0-Watermark

License

MIT