-
Notifications
You must be signed in to change notification settings - Fork 164
Watermark plugin
Jiuqing Song edited this page Feb 27, 2018
·
3 revisions
Go back to Built-in plugins
Watermark
plugin provides a watermark-like placeholder text in empty editor. Once user focused into editor or there is already content inside editor, the placeholder text will be hidden.
Watermark
is an optional plugin. To use this plugin, you need to manually create instance of this plugin and add it to your editor by createEditor() API or constructor of Editor class. To manually create an instance of this plugin, you can use its constructor:
interface DefaultFormat {
fontFamily?: string;
fontSize?: string;
textColor?: string;
backgroundColor?: string;
bold?: boolean;
italic?: boolean;
underline?: boolean;
}
constructor(private watermark: string, private format?: DefaultFormat);
This is the string to show as the watermark text.
This is the format of the watermark text. If not passed, the plugin will use the following default format:
- font size: 14px
- color: #AAAAAA
Package: roosterjs-editor-plugins
Support from: 6.3.0
Source code: Watermark.ts