Emoji Picker
Pick one emoji from a curated grid, or type any other with the device keyboard.
import { useState } from "react"
import { EmojiPicker } from "@dapplelight/signet-ui/components/emoji-picker"
export function Demo() {
const [icon, setIcon] = useState<string | null>("🎯")
return <EmojiPicker value={icon} onChange={setIcon} label="Goal icon" />
}Installation
npm i @dapplelight/signet-uiUsage
import { useState } from "react"
import { EmojiPicker } from "@dapplelight/signet-ui/components/emoji-picker"
const [icon, setIcon] = useState<string | null>("🎯")
<EmojiPicker value={icon} onChange={setIcon} label="Goal icon" />Examples
Empty
import { useState } from "react"
import { EmojiPicker } from "@dapplelight/signet-ui/components/emoji-picker"
export function Demo() {
const [icon, setIcon] = useState<string | null>(null)
return <EmojiPicker value={icon} onChange={setIcon} label="Category icon" />
}Custom set
import { useState } from "react"
import { EmojiPicker } from "@dapplelight/signet-ui/components/emoji-picker"
export function Demo() {
const [icon, setIcon] = useState<string | null>("☕")
return (
<EmojiPicker
value={icon}
onChange={setIcon}
label="Expense category"
emojis={["☕", "🍽️", "🛒", "🚗", "🏠", "💡"]}
/>
)
}API Reference
EmojiPicker
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | null | undefined | required | The selected emoji. |
onChange | (emoji: string) => void | required | Called with the chosen emoji; the popover then closes. |
emojis | string[] | DEFAULT_EMOJIS | The grid contents. |
label | string | "Choose an emoji" | Accessible name of the trigger and grid. |
className | string | none | Merged onto the trigger. |
DEFAULT_EMOJIS is exported.