tiptap-extension-twemoji
1

Usage Guide

Welcome to the Usage Guide!
This page will walk you through installation and basic usage.


๐Ÿ“ฆ Installation

Install the package with your preferred package manager:

npm install @raihancodes/tiptap-extension-twemoji-react
# or
pnpm add @raihancodes/tiptap-extension-twemoji-react
# or
yarn add @raihancodes/tiptap-extension-twemoji-react

โšก Basic Example

Example

Import the extension and add it to your editor:

import { useEditor } from "@tiptap/react";
import { StarterKit } from "@tiptap/starter-kit";
import { TwemojiExtension } from "@raihancodes/tiptap-extension-twemoji-react";

export default function Editor() {
  const editor = useEditor({
    extensions: [StarterKit, TwemojiExtension],
    content: "<p>Hello World!</p>",
    immediatelyRender: false,
  });

  return <EditorContent editor={editor} />;
}

๐Ÿ–ผ๏ธ Move Twemoji to assets

Download the image from here then move it to your public/assets/ folder. The image location can be anywhere in your public or on CDN, see here to adjust spriteUrl

๐ŸŽ‰ Congratulations!

Congratulations! Twemoji is now working in your editor. You can start typing :smile , :hug: , XD , or paste any emoji, and see it rendered instantly.


๐Ÿš€ Next Steps

  • ๐Ÿ‘‰ Check out the Custom Emojis section to learn about how to add or upload Custom Emojis.
  • ๐Ÿ‘‰ Check out the Deep Dive section to learn how to customize the extensionโ€”header, navigation, cell size, custom emojis, etc.