Emoji picker
Search, categories, recents and a grid moved with the arrows. Emoji are user content.
import { EmojiPicker, CONVERSATION_EMOJI, searchConversationEmoji, pushRecentEmoji } from "@forgeron/ui";Chosen: none
import { EmojiPicker } from "@forgeron/ui";
import { useState } from "react";
export default function Default() {
const [chosen, setChosen] = useState("");
return (
<div style={{ width: 300 }}>
<EmojiPicker onSelect={setChosen} />
<p style={{ font: "12px var(--font-mono)", color: "var(--ink-muted)" }}>
Chosen: {chosen || "none"}
</p>
</div>
);
}import { EmojiPicker, type EmojiCategory } from "@forgeron/ui";
// A set of your own: the status words of a support team, as user content.
const set: EmojiCategory[] = [
{
id: "status",
label: "Status",
mark: "โ
",
emoji: [
{ char: "โ
", name: "resolved" },
{ char: "๐", name: "looking" },
{ char: "โณ", name: "waiting" },
{ char: "๐ง", name: "blocked" },
],
},
];
export default function OwnSet() {
return (
<div style={{ width: 260 }}>
<EmojiPicker categories={set} columns={4} onSelect={() => {}} />
</div>
);
}API โ Props
| Prop | Type | Default | Description |
|---|---|---|---|
onSelect | (emoji: string) => void | โ | The character chosen. |
categories | { id, label, mark, emoji: { char, name, keywords? }[] }[] | โ | Your own set. The built-in one is small on purpose. |
recents / defaultRecents / onRecentsChange | string[] | โ | Newest first; kept by the picker unless you keep them (to store them). |
columns / maxRecents / autoFocus / label | number; number; boolean; string | โ | Layout and words. |
className | string | โ | Extra classes. |