Decoration
Decoration objects can be provided to the view through the
decorations
prop. They come in
several variants—see the static members of this class for details.
§Properties
The spec provided when creating this decoration. Can be useful if you've stored extra information in that object.
The end position. Will be the same as from
for widget
decorations.
§Static Methods
Creates an inline decoration, which adds the given attributes to
each inline node between from
and to
.
Creates a node decoration. from
and to
should point precisely
before and after a node in the document. That node, and only that
node, will receive the given attributes.
Creates a widget decoration, which is a DOM node that's shown in
the document at the given position. It is recommended that you
delay rendering the widget by passing a function that will be
called when the widget is actually drawn in a view, but you can
also directly pass a DOM node. getPos
can be used to find the
widget's current document position.