---
url: https://talkjs.com/docs/Guides/JavaScript/Classic/Custom_Emojis
---

# Custom emojis

Add or remove your own custom emojis.

Ask a question Copy for LLM [View as Markdown](/docs/Guides/JavaScript/Classic/Custom_Emojis.md)

**Note:** If you've edited your `UserMessage` theme component before 9 September 2024, you'll have to update the component for custom emoji reactions to display correctly. See the [upgrade guide](/docs/UI_Components/JavaScript/Classic/Themes/Upgrade_Guide/#custom-emojis-in-emoji-reactions-2024-09-09) for how to do this.

You can add custom [emojis](/docs/Features/Messages/Emojis/) to your chat. Custom emojis are user-defined images, such as GIFs, PNGs, or SVGs, that users can add in messages or as reactions, in addition to the built-in emoji set.

## Add custom emojis

You can add custom emoji images to your chat UI with the [`customEmojis`](/docs/UI_Components/JavaScript/Classic/Session/#ChatboxOptions__customEmojis) option.

Make sure to wrap custom emoji names in colons, for example `:party:`, to avoid any clashes with normal text.

For each emoji, you must specify a [`url`](/docs/UI_Components/JavaScript/Classic/Other_Interfaces/#CustomEmojiDefinition__url). This must be a fully qualified URL of an image file, such as an SVG, GIF, or PNG. The image must be square, so have its width equal its height. TalkJS scales your image down to the size of an emoji.

Once added, users can use custom emojis in their messages, or as reactions to messages:

Make sure you always specify a consistent, backward-compatible set of custom emojis. If an existing message contains a custom emoji that's not specified in `customEmojis`, then TalkJS can't display the emoji and displays the emoji's name instead, including colons.

## Remove custom emojis

If you'd like to remove a previously added custom emoji, you can do so safely by using the [`hidden`](/docs/UI_Components/JavaScript/Classic/Other_Interfaces/#CustomEmojiDefinition__hidden) option.

Users can't add hidden emojis to new messages, or use them in new emoji reactions, but hidden emojis still display properly in existing messages and reactions. This lets you safely remove custom emoji from the chat UI.

## Example

The following example adds three custom emoji, with the names `:lol:`, `:roomba-cat:` and `:alert:`:

```jsx
await Talk.ready;

const session = new Talk.Session({
  appId: '<APP_ID>',
  userId: 'emoji_user_alice',
});
session.currentUser.createIfNotExists({
  name: 'Alice',
});

const conversation = session.conversation('emoji_conversation');
conversation.createIfNotExists();

const chatbox = session.createChatbox({
  customEmojis: {
    ':lol:': { url: 'https://example.com/images/emoji-lol.svg' },
    ':roomba-cat:': { url: 'https://example.com/images/roomba-cat.gif' },
    ':alert:': { url: 'https://example.com/images/alert.gif', hidden: true },
  },
});
chatbox.select(conversation);
```