• English
  • Emoji shortcodes

    EmojiPlugin converts GitHub-style emoji shortcodes such as :smile: and :+1: into Unicode emoji. The Full components for React, Vue, Svelte, Angular, React Native, Lynx, Solid, and Taro include it by default; Lite components can add it as needed.

    import { Fluxdown } from 'fluxdown';
    
    export function Message() {
      return <Fluxdown text="Hello :smile: Great work :+1:" />;
    }

    The output is “Hello 😄 Great work 👍”. Emoji use the system font, so their appearance depends on the device.

    Supported content

    Shortcodes are converted in Markdown text, including headings, lists, tables, and link labels. Unknown shortcodes and unfinished input such as :smile remain unchanged. During streaming, a recognized shortcode becomes an emoji when its closing colon arrives.

    Inline code and fenced code blocks preserve their source. For example, `:smile:` displays :smile: rather than an emoji.

    Import the plugin

    All Full components include EmojiPlugin without manual registration. For Core or a Lite component, install the matching plugin package:

    pnpm add @fluxdown/core-plugins

    For Core, add EmojiRemarkPlugin to the remarks input in the quick start. Components extend their presets through plugins:

    import { EmojiRemarkPlugin } from '@fluxdown/core-plugins/plugins/remark/emoji';
    
    const remarks = [EmojiRemarkPlugin];

    Disable conversion

    Include EmojiPlugin and config in the same plugin pack to disable this behavior. Core uses a remark plugin entry with disabled set:

    import type { IPluggable, IRemarkPlugin } from '@fluxdown/types';
    
    import { EmojiRemarkPlugin } from '@fluxdown/core-plugins/plugins/remark/emoji';
    
    const remarks: IPluggable<IRemarkPlugin, unknown>[] = [
      [EmojiRemarkPlugin, { disabled: true }],
    ];