BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ncdai/twemoji

Twemoji

ncdai/twemoji
UnverifiedComponent

Render Unicode emoji as Twemoji SVG images inline with text.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/exekartik/exeKartik/main/twemoji.json

Source

src/registry/components/twemoji/twemoji.tsxraw.githubusercontent.com/exekartik/exeKartik/main/twemoji.json
1import type { ReactNode } from "react"
2
3import { cn } from "@/lib/utils"
4import emojiRegex from "@/registry/components/twemoji/lib/twemoji-regex"
5
6const VARIATION_SELECTOR_16 = /\uFE0F/g
7const ZERO_WIDTH_JOINER = String.fromCharCode(0x200d)
8
9export const TWEMOJI_CDN_URL = "https://abs-0.twimg.com/emoji/v2/svg"
10
11export type TwemojiProps = {
12 children: string
13 className?: string
14 /**
15 * Resolve an emoji code point to an image URL.
16 *
17 * @param codePoint - The Unicode code point of the emoji (e.g. `1f44d`)
18 * @returns The URL string pointing to the emoji image asset
19 *
20 * @example
21 * ```tsx
22 * source={(codePoint) => `https://cdn.example.com/emoji/${codePoint}.svg`}
23 * ```
24 * */
25 source?: (codePoint: string) => string
26}
27
28export function Twemoji({
29 children,
30 className,
31 source = defaultSource,
32}: TwemojiProps) {
33 const parts: ReactNode[] = []
34 let lastIndex = 0
35 const globalRegex = new RegExp(emojiRegex.source, "g")
36 let match
37
38 while ((match = globalRegex.exec(children)) !== null) {
39 if (match.index > lastIndex) {
40 parts.push(children.substring(lastIndex, match.index))
41 }
42
43 const rawText = match[0]
44 const codePoint = getEmojiCodePoint(rawText)
45
46 if (codePoint) {
47 parts.push(
48 <img
49 key={match.index}
50 className={cn("twemoji", className)}
51 draggable={false}
52 alt={rawText}
53 src={source(codePoint)}
54 />
55 )
56 } else {
57 parts.push(rawText)
58 }
59
60 lastIndex = globalRegex.lastIndex
61 }
62
63 if (lastIndex < children.length) {
64 parts.push(children.substring(lastIndex))
65 }
66
67 return <>{parts}</>
68}
69
70function getEmojiCodePoint(rawText: string) {
71 return toCodePoint(
72 rawText.indexOf(ZERO_WIDTH_JOINER) < 0
73 ? rawText.replace(VARIATION_SELECTOR_16, "")
74 : rawText
75 )
76}
77
78function toCodePoint(unicodeSurrogates: string, sep = "-") {
79 const result: string[] = []
80 let code = 0
81 let previous = 0
82 let i = 0
83
84 while (i < unicodeSurrogates.length) {
85 code = unicodeSurrogates.charCodeAt(i++)
86 if (previous) {
87 result.push(
88 (0x10000 + ((previous - 0xd800) << 10) + (code - 0xdc00)).toString(16)
89 )
90 previous = 0
91 } else if (0xd800 <= code && code <= 0xdbff) {
92 previous = code
93 } else {
94 result.push(code.toString(16))
95 }
96 }
97
98 return result.join(sep)
99}
100
101function defaultSource(codePoint: string) {
102 return `${TWEMOJI_CDN_URL}/${codePoint}.svg`
103}

Files it writes

  • src/registry/components/twemoji/twemoji.tsx
  • src/registry/components/twemoji/lib/twemoji-regex.ts

Facts

Registry
ncdai
Type
registry:component
Access
Unverified
Files written
2
Licence
the repository states none
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

chanhdai.com Prathamesh-exe/prathfolio on GitHub Raw registry item This item as JSON

More from ncdai

All 17 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Apple Hello Effectapple-hello-effectncdaiComponentsUnverified1 dep
Apple Hello Effect - Hindiapple-hello-effect-hindincdaiComponentsUnverified1 dep
Apple Hello Effect - Spanishapple-hello-effect-spanishncdaiComponentsUnverified1 dep
Apple Hello Effect - Vietnameseapple-hello-effect-vietnamesencdaiComponentsUnverified1 dep
Brand Assets Menubrand-assets-menuncdaiComponentsUnverified1 dep
chevrons-up-down-iconchevrons-up-down-iconncdaiComponentsUnverified1 dep
Code Block Commandcode-block-commandncdaiComponentsUnverified4 deps · 3 files
Consent Managerconsent-managerncdaiComponentsUnverified1 dep · 2 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex