Skip to content

Emoji icon API

Find each public package entry and the current core, React, provider, and accent contracts.

Export map

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?) accepts (signal: AbortSignal) => EmojiIconCatalog | Promise<EmojiIconCatalog> and returns { status, catalog?, error?, reload }. It cancels stale/unmounted work; errors are exposed without automatic retry. useEmojiIconPickerContext() is exported from @ghost-ui/core/components/emoji-icon-picker; it returns the state for a styled Root and throws outside that context.

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.