> For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/llms-full.txt.

# Watermark

General`@rockshin/tao-ui`

[Examples](#examples)[API](#api)

Repeats text or an image across content and inherited dialogs.

This native tao-ui component follows the public API of Ant Design 6.7.0. Appearance, theme tokens and Semantic DOM customization belong to tao-ui; configure themes with `TaoProvider`.

Canvas drawing follows the 6.7.0 content/font/gap/offset API. Modal and Drawer inherit by default; inherit=false disables portal inheritance. Removed or changed overlays are restored.

## When to use

Use to mark an owner, workspace or document classification while keeping the content readable.

## Examples


### Text watermark
```tsx preview
import { Watermark } from "@rockshin/tao-ui";

export default function Example() {
  return (
    <Watermark content="Tao workspace">
      <div style={{ height: 220, padding: 20 }}>
        <h4>Workspace report</h4>
        <p>Content remains selectable and interactive.</p>
      </div>
    </Watermark>
  );
}
```

### Multiple lines and fonts
```tsx preview
import { Watermark } from "@rockshin/tao-ui";

export default function Example() {
  return (
    <Watermark
      content={[
        { text: "CONFIDENTIAL", font: { fontWeight: 700, fontSize: 18 } },
        { text: "Review copy", font: { fontSize: 12 } },
      ]}
      font={{ color: "rgba(80, 100, 110, 0.22)" }}
    >
      <div style={{ height: 240 }} />
    </Watermark>
  );
}
```

### Rotation, gap and offset
```tsx preview
import { Watermark } from "@rockshin/tao-ui";

export default function Example() {
  return (
    <Watermark
      content="Tao"
      rotate={-35}
      gap={[70, 60]}
      offset={[50, 40]}
      width={80}
      height={30}
    >
      <div style={{ height: 220 }} />
    </Watermark>
  );
}
```

### Image with text fallback
```tsx preview
import { Watermark } from "@rockshin/tao-ui";

const image = `data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="40"><text x="10" y="28" font-size="24" fill="#668b8b" opacity="0.5">TAO</text></svg>')}`;

export default function Example() {
  return (
    <Watermark
      image={image}
      content="Tao"
      width={100}
      height={40}
      gap={[80, 70]}
    >
      <div style={{ height: 240 }} />
    </Watermark>
  );
}
```

### Inherited Modal and Drawer
```tsx preview="iframe-follow"
import { useState } from "react";
import { Button, Drawer, Modal, Watermark } from "@rockshin/tao-ui";

export default function Example() {
  const [panel, setPanel] = useState("");
  return (
    <Watermark content="Private">
      <div style={{ minHeight: 220, padding: 20 }}>
        <Button onClick={() => setPanel("modal")}>Open modal</Button>{" "}
        <Button onClick={() => setPanel("drawer")}>Open drawer</Button>
        <Modal
          open={panel === "modal"}
          onClose={() => setPanel("")}
          title="Marked modal"
          footer={null}
        >
          <div style={{ height: 150 }}>
            This portaled panel inherits the watermark.
          </div>
        </Modal>
        <Drawer
          open={panel === "drawer"}
          onClose={() => setPanel("")}
          title="Marked drawer"
        >
          <p>The drawer inherits the same watermark.</p>
        </Drawer>
      </div>
    </Watermark>
  );
}
```

### Disable portal inheritance
```tsx preview="iframe-follow"
import { useState } from "react";
import { Button, Modal, Watermark } from "@rockshin/tao-ui";

export default function Example() {
  const [open, setOpen] = useState(false);
  return (
    <Watermark content="Page only" inherit={false}>
      <div style={{ minHeight: 220, padding: 20 }}>
        <Button onClick={() => setOpen(true)}>Open unmarked modal</Button>
        <Modal
          open={open}
          onClose={() => setOpen(false)}
          title="No inherited mark"
          footer={null}
        >
          Only the containing page has a watermark.
        </Modal>
      </div>
    </Watermark>
  );
}
```

## API


### [#](#watermark)Watermark



| Property | Description | Type | Default Value |
| --- | --- | --- | --- |

