Skip to content
Star

Emoji icon API

Look up picker imports, return values, and defaults.

Export map

Set size to "base", "lg", or "touch" for a 32px, 40px, or 44px reaction target and a 16px, 20px, or 22px glyph. The same option sizes the full picker grid.

Core functions

React hooks

useEmojiIconPicker<M>(options: EmojiIconPickerOptions<M>) returns catalog, controlled/current values, visible and selected items, state setters, and Combobox props. value, query, category, tone, and open are independently controllable with matching on…Change callbacks; defaultValue, defaultQuery, defaultCategory, defaultTone, and defaultOpen initialize uncontrolled values. Defaults: empty items/categories, null value/category, empty query, tone 0, closed, inline=false, closeOnSelect=true, disabled=false, virtualized=false, status="ready". columns is optional. filter and score constrain/rank items. Selection callbacks receive (value: EmojiIconSelection | null, item: ResolvedEmojiIcon | null).

useEmojiIconCatalog(resolver, key?) takes a resolver that receives an AbortSignal and returns a catalog or a promise. The hook returns { status, catalog?, error?, reload }, cancels stale requests, and lets you call reload to retry. Inside the styled picker, import useEmojiIconPickerContext from the same component path as Root. It throws outside that root.

Adapters, providers, and accent

fromEmojibase(data, shortcodes?, categoryLabels?), fromEmojiMart(data, custom = []), and fromFrimousse(data) return EmojiIconAdapterResult (items, categories, optional categoryLabels). They consume caller-supplied data and do not import vendor packages.

createEmojiIconProvider<P>(options: { id, definitions, capabilities? }) returns id, items, categories, optional capabilities, and renderIcon(content, props): ReactNode. It throws for empty provider/name/label, duplicate names, missing renderers, or non-array definitions; unknown provider/name or unsupported style/weight/corners returns null. createLucideEmojiIconProvider(definitions) accepts static Lucide definitions and supports outline, round corners, and stroke width; it does not accept arbitrary icon geometry.

accentFromPixels(pixels: Uint8ClampedArray): string | null returns a sampled color or null for unusable pixels. detectEmojiIconAccent(source, options?): Promise<string | null> samples { emoji } or { src }; options include signal and size (default 64, clamped to 16–128). Unsupported canvas, tainted image, load failure, or abort returns null.

Core types

Core types are EmojiIconTone, EmojiIconContent, EmojiIconProvider<M>, EmojiIconVariant, EmojiIconItem<M>, EmojiIconSelection, ResolvedEmojiIcon<M>, EmojiIconSearchOptions<M>, EmojiIconGroup<M>, EmojiIconUsageRecord, and EmojiIconCatalog<M>. Exact required fields, identity semantics, and content discriminants are in Emoji icon data; state ownership and cancellation are in Emoji icon state.