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.
- Host: GitHub
- URL: https://github.com/kid-1912/tiptap-extension-float
- Owner: KID-1912
- Created: 2024-02-01T03:23:35.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-04T17:13:31.000Z (over 1 year ago)
- Last Synced: 2025-09-20T05:51:10.607Z (9 months ago)
- Topics: align, extension, float, tiptap
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tiptap-extension-float
An extension to add float to your tiptap content.
---
## 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