Twemoji
Render Unicode emoji as Twemoji SVG images inline with text.
Features
- Consistent emoji rendering across all platforms and browsers.
- Customizable image source for self-hosting or alternative CDNs.
- Server component compatible.
Installation
pnpm dlx shadcn@latest add @nrcode/twemoji
Usage
import { Twemoji } from "@/components/twemoji"<Twemoji>Hello from Cambodia 🇰🇭</Twemoji>API reference
Twemoji
Prop
Type
Examples
Custom source
<Twemoji
source={(codePoint) =>
`https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/${codePoint}.svg`
}
>
Hello from Cambodia 🇰🇭
</Twemoji>