prosekit/extensions/placeholder
PlaceholderOptions
placeholder
The placeholder to use. It can be a static string or a function that receives the current editor state and returns a string.
Type:
string | ((state: EditorState) => string)
strategy
By default, the placeholder text will be shown whenever the current text cursor is in an empty text node. If you only want to show the placeholder when the whole doc is empty, you can set this option to 'doc'.
Type:
"doc" | "block"
Default:
'block'
definePlaceholder
ts
function definePlaceholder(options: PlaceholderOptions): PlainExtension
Add a placeholder text to the editor when the current block or document is empty.