Skip to content
Knowns UI
Get ProSign in

Emoji Picker

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
Used for
  • 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

Size
Per line

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

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-picker
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

onSelect
(pick: EmojiPick) => void
A pick: { emoji, base, name, shortcode, skin }. emoji has the tone applied; base is without it.
recent / defaultRecent
string[]
Defaultstored
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
Default24
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
Default0
Default yellow, then light to dark. Controlled with onSkinToneChange.
onSkinToneChange
(tone: SkinTone) => void
A tone picked in the tone row.
categories
EmojiSection[]
Defaultall
Sections and their order: recent, smileys, people, nature, food, travel, activities, objects, symbols, flags. Search only looks in these.
perLine
number
Default8
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
Default288
Height of the scrolling grid, px.
autoFocus
boolean
Defaultfalse
Focus the search on mount. The popover focuses it anyway.
data
() => Promise<EmojiItem[]>
Defaultbuilt-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
Defaulttrue
Drop emoji newer than the device draws, measured once on a canvas.
preview
boolean
Defaulttrue
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
Defaulttrue
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
Defaultsmile 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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

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" }).

Need help?

Stuck on Emoji Picker, or found something off? We read every message.