An open API service indexing awesome lists of open source software.

https://github.com/kid-1912/tiptap-extension-float

An extension to add float to your tiptap content.
https://github.com/kid-1912/tiptap-extension-float

align extension float tiptap

Last synced: 4 months ago
JSON representation

An extension to add float to your tiptap content.

Awesome Lists containing this project

README

          

# tiptap-extension-float


An extension to add float to your tiptap content.




NPM URL

version


---

## Install

```shell
npm install tiptap-extension-float -S
```

## Usage

```js
import Float from "tiptap-extension-float";

const editor = new Editor({
element: document.querySelector(".editor"),
extensions: [StarterKit, Image.configure({ inline: true }), Float],
});

editor.chain().focus().updateAttributes("image", { float: "left" }).run();
// default: cancel float style
editor.chain().focus().updateAttributes("image", { float: "default" }).run();
```

## Options

You can configure extension options, which are optional.

```js
extensions: [
StarterKit,
Image.configure({ inline: true }),
Float.configure({
types: ["image"], // Allow float node types
}),
],
```

## Relations

**tiptap/extension-text-align:** https://github.com/ueberdosis/tiptap/tree/main/packages/extension-text-align

**tiptap-appmsg-editor:** https://github.com/KID-1912/tiptap-appmsg-editor