1.0.0 • Published 1 year ago

tiptap-extension-float v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

tiptap-extension-float


Install

npm install tiptap-extension-float -S

Usage

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.

  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

1.0.0

1 year ago