slash-editor
Guides

Emoji

The `:shortcode:` picker and the /emoji slash item.

emoji is opt-in — it stays unregistered until you enable it, since the bundled dataset (@tiptap/extension-emoji) is sizeable. The node lives in its own entry, @slash-editor/core/emoji, so the dataset only reaches bundles that import it; build it there and hand it to the kit:

import { emoji } from "@slash-editor/core/emoji";

useSlashEditor({
  blockKit: {
    emoji: emoji({ limit: 24 }),
  },
});

Enabling it adds three things:

  • A : picker. Typing : after whitespace opens a menu filtered by name, shortcode, and tag. useEmoji exposes its state; the Emoji Menu component renders it.
  • A /emoji slash item, shown only while the node is registered. It types the : for you, so the picker opens straight away.
  • :shortcode: input and paste rules, plus conversion of pasted unicode emoji into nodes. These come from Tiptap's emoji extension.
Option (of emoji())DefaultDescription
limit24Maximum results the picker lists for a query.
emojisbundledDataset to search — append custom emojis with a fallbackImage.
enableEmoticonsfalseTurn :) followed by a space into an emoji.
forceFallbackImagesfalseAlways render fallbackImage instead of the unicode glyph.
suggestion—Override the picker's items, char, minQueryLength, and so on.

Markdown

An emoji exports as :shortcode: (GitHub renders it as the glyph) and imports back into an emoji node. A shortcode the dataset does not know — 12:30:45 — stays plain text.

On this page