# Emoji and icons

Add a reaction picker or search your own emoji and icon catalog.

## Render a reaction picker

Use EmojiIconPicker to let people choose an emoji, image, or icon.

Install [the npm package and shared component styles](/docs/installation#package), then add the picker’s grid dependency.

```bash
npm install @tanstack/react-virtual@3.14.13
```

Render ReactionPicker and open Choose a reaction to try the supplied items.

```tsx
import { useState } from "react";
import { EmojiIconPicker } from "@collectivecreation/ghost-ui/components/emoji-icon-picker";
import type { EmojiIconSelection } from "@collectivecreation/ghost-ui/emoji-icon-picker";
const items = [{ id: "wave", label: "Wave", content: { type: "emoji" as const, text: "👋" } }];
export function ReactionPicker() {
  const [value, setValue] = useState<EmojiIconSelection | null>(null);
  return <EmojiIconPicker items={items} value={value} onValueChange={setValue}
    triggerProps={{ "aria-label": "Choose a reaction" }} />;
}

```

For your own view, start with the [picker hooks and loading guide](/libraries/emoji-icon-picker-state). For localized data and icon sets, see [catalogs and providers](/libraries/emoji-icon-picker-data).

## Look up a selection

```ts
import { createEmojiIconCatalog, resolveEmojiIcon } from "@collectivecreation/ghost-ui/emoji-icon-picker";

const catalog = createEmojiIconCatalog([{
  id: "brand:spark", label: "Brand spark",
  content: { type: "image", src: "/emoji/spark.gif", alt: "A gold spark" },
  category: "custom", keywords: ["celebrate"],
}]);
const selection = { id: "brand:spark" };
const item = resolveEmojiIcon(catalog, selection);
console.log(item?.content);
```

The example logs the image record for brand:spark. Save the item ID and, when selected, the exact variant ID. Resolve those IDs against the current catalog when you render the selection.

## Choose the imports you need

A catalog is an indexed collection of emoji, images, and icons. Use the styled picker for a ready-made React view, or import the core to search and look up selections in your own interface.

| Import | Use |
| --- | --- |
| @collectivecreation/ghost-ui/emoji-icon-picker | Data-free catalog, search, grouping, selection and usage operations; no React, DOM or CSS dependency. |
| @collectivecreation/ghost-ui/emoji-icon-picker-react | React hooks for picker state and async catalog resolution. |
| @collectivecreation/ghost-ui/emoji-icon-picker-data | Optional bundled Unicode dataset and catalog. |
| @collectivecreation/ghost-ui/emoji-icon-picker-adapters | Structural conversion from Emojibase, Emoji Mart, or Frimousse data. |
| @collectivecreation/ghost-ui/emoji-icon-picker-provider | React provider factory for caller-owned icon definitions/renderers. |
| @collectivecreation/ghost-ui/emoji-icon-picker-lucide | Static Lucide provider helper. |
| @collectivecreation/ghost-ui/emoji-icon-picker-accent | Explicit optional browser canvas accent sampling. |
| @collectivecreation/ghost-ui/components/emoji-icon-picker | Styled React EmojiIconPicker parts. |

## Store selections and resolve them later

EmojiIconContent uses a type of emoji, image, or icon. Catalog creation checks required IDs, labels, and content, and throws on duplicate item or variant IDs.

Your app decides which items are available, how to localize them, and where to save selections. If a saved item becomes unavailable, show a fallback and let the user pick again. See the [API reference](/libraries/emoji-icon-picker-api) for exports and return values.

The styled EmojiIconPicker.Simple and complete picker accept size="base" | "lg" | "touch"; this sets 32px/16px, 40px/20px, or 44px/22px targets and glyphs. For the styled view’s dependencies, layout and CSS, use the [component page](/components/emoji-icon-picker).
