Pick a native emoji by search or by category, with recently used, skin tones and a preview of the name and shortcode. The grid works from the keyboard, the list loads on demand, and it sits inline or in a popover.
On this page
- React to a comment or a message
- Add an emoji to a chat message
- Set a status or a page icon
- Type :tada in an editor
Examples
In a popover
Comment reactions
The quick row in Comment ends with More reactions, which opens the full picker in the same panel. Hover the comment, press the smile, then the last button.
In the chat composer
Shortcodes in the editor
Skin tone
Your own list
data replaces the built-in English list with your own items, in any language. Each item has the emoji, a name, shortcodes, keywords, a category and the Emoji version; skin is "1" for emoji that take a tone right after the first character. This one has 16 emoji with Vietnamese names: try "cà phê" or "mua".
Installation
npx knowns-ui@latest add emoji-pickerPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Emoji picker from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/emoji-picker
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add emoji-picker
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/popover.tsx
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/emoji-picker/emoji-picker.tsx
- components/ui/knowns/emoji-picker/emoji-data.ts
- components/ui/knowns/emoji-picker/emoji-picker-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/emoji-picker, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "emoji-picker" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- onSelect
(pick: EmojiPick) => void- A pick: { emoji, base, name, shortcode, skin }. emoji has the tone applied; base is without it.
- recent / defaultRecent
string[]- Default
stored - Recently used, newest first. Controlled with onRecentChange, or a start when nothing is stored yet.
- onRecentChange
(recent: string[]) => void- After each pick, with the emoji first and an older copy dropped.
- recentLimit
number- Default
24 - How many recents to keep.
- persist
string|false- Default
"kn-emoji-picker" - The localStorage key for recents and the tone. false keeps them in memory only. Pickers with the same key stay in step.
- skinTone / defaultSkinTone
0|1|2|3|4|5- Default
0 - Default yellow, then light to dark. Controlled with onSkinToneChange.
- onSkinToneChange
(tone: SkinTone) => void- A tone picked in the tone row.
- categories
EmojiSection[]- Default
all - Sections and their order: recent, smileys, people, nature, food, travel, activities, objects, symbols, flags. Search only looks in these.
- perLine
number- Default
8 - Cells per row. The picker is perLine cells wide and never wider than its container.
- size
"sm"|"md"|"lg"- Default
"md" - Cell size, 32, 36 or 40px.
- height
number- Default
288 - Height of the scrolling grid, px.
- autoFocus
boolean- Default
false - Focus the search on mount. The popover focuses it anyway.
- data
() => Promise<EmojiItem[]>- Default
built-in - Your own list: another language or a trimmed set. The built-in English list is about 45 KB gzipped, loaded on first mount.
- hideUnsupported
boolean- Default
true - Drop emoji newer than the device draws, measured once on a canvas.
- preview
boolean- Default
true - The bottom row with the big emoji, the name and :shortcode:.
- placeholder
string- Default
"Search emoji" - The search field's placeholder.
- onClose
() => void- Escape with an empty search.
- frame
boolean- Default
true - Its own card. false inside a surface that has one.
- aria-label
string- Default
"Emoji picker" - The name of the picker group.
- EmojiPickerPopover: trigger
ReactElement- Default
smile button - The button that opens it. Takes every picker prop, plus open, defaultOpen, onOpenChange, side, align and closeOnSelect (default true).
| Prop | Type | Default | Description |
|---|---|---|---|
| onSelect | (pick: EmojiPick) => void | - | A pick: { emoji, base, name, shortcode, skin }. emoji has the tone applied; base is without it. |
| recent / defaultRecent | string[] | stored | Recently used, newest first. Controlled with onRecentChange, or a start when nothing is stored yet. |
| onRecentChange | (recent: string[]) => void | - | After each pick, with the emoji first and an older copy dropped. |
| recentLimit | number | 24 | How many recents to keep. |
| persist | string | false | "kn-emoji-picker" | The localStorage key for recents and the tone. false keeps them in memory only. Pickers with the same key stay in step. |
| skinTone / defaultSkinTone | 0 | 1 | 2 | 3 | 4 | 5 | 0 | Default yellow, then light to dark. Controlled with onSkinToneChange. |
| onSkinToneChange | (tone: SkinTone) => void | - | A tone picked in the tone row. |
| categories | EmojiSection[] | all | Sections and their order: recent, smileys, people, nature, food, travel, activities, objects, symbols, flags. Search only looks in these. |
| perLine | number | 8 | Cells per row. The picker is perLine cells wide and never wider than its container. |
| size | "sm" | "md" | "lg" | "md" | Cell size, 32, 36 or 40px. |
| height | number | 288 | Height of the scrolling grid, px. |
| autoFocus | boolean | false | Focus the search on mount. The popover focuses it anyway. |
| data | () => Promise<EmojiItem[]> | built-in | Your own list: another language or a trimmed set. The built-in English list is about 45 KB gzipped, loaded on first mount. |
| hideUnsupported | boolean | true | Drop emoji newer than the device draws, measured once on a canvas. |
| preview | boolean | true | The bottom row with the big emoji, the name and :shortcode:. |
| placeholder | string | "Search emoji" | The search field's placeholder. |
| onClose | () => void | - | Escape with an empty search. |
| frame | boolean | true | Its own card. false inside a surface that has one. |
| aria-label | string | "Emoji picker" | The name of the picker group. |
| EmojiPickerPopover: trigger | ReactElement | smile button | The button that opens it. Takes every picker prop, plus open, defaultOpen, onOpenChange, side, align and closeOnSelect (default true). |
Keyboard
- The search field comes first. ArrowDown moves into the grid; Enter picks the first result; Escape clears the search, then closes.
- In the grid, the arrows move by cell and by row (keeping the column across categories), Home and End go to the ends of the row and Ctrl+Home and Ctrl+End to the ends of the grid, PageUp and PageDown move a screen of rows.
- Enter or Space picks. Any letter or Backspace goes back to the search with the letter typed.
- Tab moves from the search to the tone button, the category bar (arrows move along it), and the one cell of the grid in the Tab order.
Accessibility
- The grid follows the ARIA grid pattern: a row group per category named by its header, rows of grid cells, and a roving tabindex so one cell is in the Tab order.
- Each cell is named after its emoji (Thumbs up), not the character, so a screen reader reads words.
- One polite live region says how many emoji a search found, the emoji just picked and a new skin tone.
- The tone row is a radio group; each tone is named (Medium dark) and checked when chosen.
- The preview row repeats what the focused cell already says, so it is hidden from assistive tech.
What it handles
- 01Searches names, keywords and shortcodes at once and ranks them: an exact shortcode or name first, then a prefix, then a word of the name, then a keyword. Every word typed must match, and a pasted emoji finds itself.
- 02Loads the emoji list (1,906 emoji, about 45 KB gzipped) as its own chunk the first time a picker mounts, so importing the picker adds a few KB to the page. Every picker and the editor's shortcode list share that one load.
- 03Keeps Recently used and the skin tone per browser in localStorage, read after hydration so the server and the first paint agree; pass recent and skinTone to keep them in your own store instead.
- 04Applies the skin tone to every emoji that takes one, including people in pairs, and leaves the rest alone. onSelect says which tone it applied.
- 05Hides emoji newer than the device can draw, measured once on a small canvas, so nobody sees an empty box. Without a canvas (a test, a server) everything stays.
- 06Moves through the grid with the arrows, Home, End, PageUp and PageDown, keeps one cell in the Tab order, sends any letter typed in the grid back to the search, and closes on Escape.
States
- First render
- Nothing moves; a short placeholder grid shows until the list arrives
- none
- Popover opens or closes
- The panel fades in place
- 120ms, ease out
- Hover a cell
- Its background tints and the emoji grows to 1.17
- 120ms, ease out
- Move with the keyboard, change tab, search
- Focus, the highlighted cell and the scroll jump at once
- none
- Skin tone row opens
- The six tones fade in over the search field
- 120ms, ease out
- Pick
- onSelect runs at once; the popover closes and focus goes back to the button
- 120ms fade
- Reduced motion
- No growth and no fades; every change is instant
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing moves; a short placeholder grid shows until the list arrives | none |
| Popover opens or closes | The panel fades in place | 120ms, ease out |
| Hover a cell | Its background tints and the emoji grows to 1.17 | 120ms, ease out |
| Move with the keyboard, change tab, search | Focus, the highlighted cell and the scroll jump at once | none |
| Skin tone row opens | The six tones fade in over the search field | 120ms, ease out |
| Pick | onSelect runs at once; the popover closes and focus goes back to the button | 120ms fade |
| Reduced motion | No growth and no fades; every change is instant | 0ms |
Works with
When to use
When to use
- Reacting to a comment or a message, or adding an emoji to what someone types, with search, recents and skin tones.
- Picking an icon for a status, a page or a channel.
When not to use
- A fixed row of four to six reactions: use Comment.
- Emoji that burst on the page as an effect: use Emoji Lens.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Emoji Picker to my app and wire it to my own data.
- I need reacting to a comment or a message, or adding an emoji to what someone types, with search, recents and skin tones. Set that up with the Knowns UI Emoji Picker.
- Which Emoji Picker props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "emoji-picker" }) and search_docs({ query: "emoji picker" }).