tiptap/docs/api/extensions/dropcursor.md

30 lines
1.6 KiB
Markdown
Raw Normal View History

# Dropcursor
2021-01-25 17:35:52 +08:00
[![Version](https://img.shields.io/npm/v/@tiptap/extension-dropcursor.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-dropcursor)
[![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-dropcursor.svg)](https://npmcharts.com/compare/@tiptap/extension-dropcursor?minimal=true)
2020-11-18 19:34:48 +08:00
This extension loads the [ProseMirror Dropcursor plugin](https://github.com/ProseMirror/prosemirror-dropcursor) by Marijn Haverbeke, which shows a cursor at the drop position when something is dragged into the editor.
2020-11-06 04:39:08 +08:00
2020-11-18 19:34:48 +08:00
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
```bash
# with npm
npm install @tiptap/extension-dropcursor
# with Yarn
yarn add @tiptap/extension-dropcursor
```
2020-11-18 19:12:34 +08:00
## Settings
| Option | Type | Default | Description |
| ------ | -------- | ---------------- | --------------------------------------------------------------------- |
| color | `String` | `'currentcolor'` | Color of the dropcursor. |
| width | `Number` | `1` | Width of the dropcursor. |
| class | `String` | | One or multiple CSS classes that should be applied to the dropcursor. |
2020-11-18 19:12:34 +08:00
## Source code
2021-04-21 21:31:11 +08:00
[packages/extension-dropcursor/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-dropcursor/)
## Usage
<tiptap-demo name="Extensions/Dropcursor"></tiptap-demo>