Skip to content
EspañolEnglish
All components (283)

Watermark

Utilities · Watermark · .amset-watermark

What it is and when to use it

A text repeated over the content: "Draft", "Confidential". It is a visual notice, not a protection: whoever has the HTML can remove it.

When to use it

  • A document that is not valid yet, or should not be forwarded.
  • rotate is the rotation and gap the spacing between repetitions.

When not to

  • Really protecting a document: that is done when generating it, on the server.
  • A notice that must be read: Alert.

Keyboard: there is nothing to press, and it does not get in the way: what lies beneath can still be pressed and selected.

Accessibility: the drawing is hidden from the reader, and the text is said only once, not once per repetition.

Fine-tuning: --amset-watermark-opacity is how noticeable it is. The colour comes from the theme.

What it looks like

Quote 2026-118

Client: Joyería Aurelia · 12 March 2026

Awaiting signature
Quote lines
ItemAmount
Flooring and paint6.200 €
Lighting4.350 €
Custom counter5.800 €
Installation and VAT2.050 €
Total incl. VAT18.400 €

Lead time: six weeks from signing. Offer valid for 30 days.

Draft

<Card title="Quote 2026-118" subtitle="Client: Joyería Aurelia · 12 March 2026">
  <Watermark text="Draft" gap={96}>
    <table>…quote lines and total…</table>
    <p>Lead time: six weeks from signing. Offer valid for 30 days.</p>
  </Watermark>
</Card>

Props

Import it with import { Watermark } from '@amset/ui'. Required props are marked.

PropTypeWhat it does
childrenrequiredReactNode—
classNamestringMerged with the library classes; it does not replace them.
colorstringText color. Defaults to the theme one.
fontWatermarkFont—
gapnumber | readonly [number, number]Space between repetitions, in pixels: one number for both directions, or `[horizontal, vertical]`. Defaults to 180.
imagestringAn image that repeats instead of the text. If it does not load, the text shows. `text` or `image` is needed.
onRemove() => voidCalled if someone removes the watermark from the document; before it is painted again.
opacitynumberHow visible it is, from 0 to 1. Defaults to 0.14.
rotatenumberDegrees of rotation. By default, -24.
textstring | readonly string[]What repeats: «Draft», «Confidential». A list gives one line per text.

It also accepts the attributes of the element it renders: className, style, data-*, aria-* and its events.

CSS variables

These CSS variables are how you adapt it. Declare them on the component's selector, not on :root: the stylesheet redeclares them in the rule itself, and a declaration on the same element always wins.

VariableDefault
--amset-watermark-opacity0.14

How to change it

.amset-watermark {
  --amset-watermark-opacity: ...;
}

In the test bench

Every state and variant, to try one at a time, on its page at storybook.amsetui.com: