- Nuxt 4 ready - Emoji 17.0 support - Render emoji by character - Render emoji by codepoint - Render emoji by definition object - SVG rendering by default - SVG caching with localStorage - PNG image render option - Twitter Emoji assets from ex-Twitter author (jdecked/twemoji) fork repository - Assets from the jsDelivr CDN - Multiples ways of use
Quick Setup
1. Add nuxt-twemoji dependency to your project
``bash npx nuxi@latest module add twemoji `
2. Add nuxt-twemoji to the modules section of nuxt.config.ts
You can make use of any of these available components according to your Nuxt app needs.
| Name | Description | SSR | | -----|---------|----------| | Twemoji | Renders Twemojis by emoji characters, codepoint or definition. | ✔️ | | Twemojify | Parses a text and replaces all emoji characters with Twemoji svg elements or png images. | ✔️ | | TwemojiParse | Wrap elements with the component and it will parse all emoji characters found with Twemoji svg or png image elements. | ❌
Usage (Twemoji)
1. Find emojis from emojipedia, getemoji or unicode emoji list 2. In your project, use the component , where emoji is the emoji character or codepoint. 3. If you employ SSR (Server Side Rendering) in your Nuxt application, this module will inject the emoji
$3
| Property | Required | Default | Type | |----------|----------|---------|-------------------------------| | emoji | Yes | | string or EmojiDefinition | | size | No | 1em | string | | mode | No | | svg \| png |
$3
Use the emoji property to render an emoji by character.
`html
`
Use the emoji property to render an emoji by codepoint.
`html `
or
`html `
Use the emoji property to render an emoji by definition.
`html
`
The emojis file has been generated using the self made
generateEmojis.js script, which fetches emojis data from the Unicode public Emoji 17.0 file available at https://unicode.org/Public/17.0.0/emoji/emoji-test.txt
$3
The EmojiDefinition type represents objects that have these specific three string properties:
-
code represents the code associated with the emoji. - emoji represents the actual emoji. - name represents the name of the emoji.`ts type EmojiDefinition = { code: string, emoji: string, name: string } `