npm install tiptap-extension-float -S
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();
You can configure extension options, which are optional.
extensions: [
StarterKit,
Image.configure({ inline: true }),
Float.configure({
types: ["image"], // Allow float node types
}),
],
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