tiptap/docs/api/extensions/dropcursor.md
2021-10-18 18:01:47 +02:00

1.5 KiB
Raw Blame History

description icon
Adds a cursor when something is dragged inside the editor. drag-drop-line

Dropcursor

Version Downloads

This extension loads the ProseMirror Dropcursor plugin by Marijn Haverbeke, which shows a cursor at the drop position when something is dragged into the editor.

Note that tiptap is headless, but the dropcursor needs CSS for its appearance. There are settings for the color and width, and youre free to add a custom CSS class.

Installation

# with npm
npm install @tiptap/extension-dropcursor

# with Yarn
yarn add @tiptap/extension-dropcursor

Settings

color

Color of the dropcursor.

Default: 'currentcolor'

Dropcursor.configure({
  color: '#ff0000'
})

width

Width of the dropcursor.

Default: 1

Dropcursor.configure({
  width: 2,
})

class

One or multiple CSS classes that should be applied to the dropcursor.

Dropcursor.configure({
  class: 'my-custom-class',
})

Source code

packages/extension-dropcursor/

Usage

https://embed.tiptap.dev/preview/Extensions/Dropcursor