What it does
Twemoji provides Unicode emoji artwork and a JavaScript parser that replaces emoji text with image elements. Its maintained project includes SVG and PNG delivery and separate graphics and code licensing.
Install @twemoji/api to replace standard Unicode emoji in a web page with Twemoji images. Calling the DOM parser on an element changes emoji within text nodes while retaining surrounding elements and listeners. The legacy string parser does not sanitize input, so the documented DOM route is the appropriate starting point for a comment or message interface.
PNG output defaults to 72 by 72 pixels. Options can select SVG files, change the asset base URL or CSS class, and use a callback to leave selected characters unchanged. The document must use UTF-8. Custom chat stickers are outside the library’s standard-Unicode scope.
The package and files are available without a product account or licence fee. Code uses MIT; artwork uses CC BY 4.0 and requires credit. The project accepts attribution in places such as a website’s About section, footer or project README.
Strengths
- Documents DOM parsing that preserves surrounding nodes and listeners.
- Supports configurable SVG or PNG asset delivery.
Watch out for
- The legacy string parser does not sanitize input.
- Graphics require attribution.
Best for
- Web applications standardising emoji appearance.
- Comment or messaging interfaces integrating emoji images.
Sources
- Maintained Twemoji official README (Oct 27, 2026)
- Twemoji graphics CC BY 4.0 license (Oct 27, 2026)
