Skip to content
Haze UI

Emoji picker

Search a configurable emoji list with categories, session recents and skin tones, backed by a native select.

pnpm dlx shadcn@latest add @haze/emoji-picker
Open preview in a new tab
Livesmall script

When to use

  • A status or update form needs a compact searchable set of named emoji.
  • Products should control the emoji vocabulary while keeping a native selection fallback.

When not to use

  • Use reactions for a small fixed collection of independent acknowledgments.
  • Use select when only a few textual status choices are necessary.

Installation

Add the Haze registry to components.json once, then install Emoji picker with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/emoji-picker
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
id*string–Unique caller supplied prefix for the control and its associated content.
namestringidName submitted by the native form control.
labelstringChoose an emojiLegend describing the emoji selection.
valuestringEmptyInitially selected emoji string.
items{ emoji: string; label: string; category: string; keywords?: string; tones?: string[] }[]22 curated emojiSearchable vocabulary; tones lists the five standard skin variations when supported.
disabledbooleanfalsePrevents user changes through the native disabled state.
classstring–Additional classes on this component's outer wrapper.
[key: string]unknown–Additional attributes applied to the submitted native select.

Keyboard interactions

Down from search
Focus the first matching emoji.
ArrowsHomeEnd
Move among visible emoji choices.
EnterSpace
Select the focused emoji.
Escape in search
Clear a nonempty query without closing a surrounding overlay.

Accessibility

  • The native select is labelled and stays available before and after enhancement, so the selected Unicode value always submits normally.
  • Search filters by label, keywords and emoji, and a polite region reports matching counts and selections.
  • The emoji buttons form a labelled group with one Tab stop; arrow keys, Home and End navigate the visible buttons.
  • Category selection is expressed with pressed state and skin tone uses a labelled native select; variants are only offered for supplied supported gestures.
  • Recent choices are held only in this component's session, and the default curated list is intentionally smaller than the full Unicode emoji catalog.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI component "Emoji picker" with `npx shadcn@latest add @haze/emoji-picker`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import EmojiPicker from "@/components/haze/ui/emoji-picker.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/ui/emoji-picker.md

  • Customize with real content

    Adapt the Haze emoji-picker ui for our product. Replace the demo values of these props with our real content: id, name, label, value, items, disabled, class, [key: string]. Keep the layout, the heading level rules and these accessibility details: The native select is labelled and stays available before and after enhancement, so the selected Unicode value always submits normally. Search filters by label, keywords and emoji, and a polite region reports matching counts and selections. The emoji buttons form a labelled group with one Tab stop; arrow keys, Home and End navigate the visible buttons. Category selection is expressed with pressed state and skin tone uses a labelled native select; variants are only offered for supplied supported gestures. Recent choices are held only in this component's session, and the default curated list is intentionally smaller than the full Unicode emoji catalog. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using emoji-picker, check it fits: use it when a status or update form needs a compact searchable set of named emoji.; products should control the emoji vocabulary while keeping a native selection fallback.. Avoid it when use reactions for a small fixed collection of independent acknowledgments.; use select when only a few textual status choices are necessary.. Alternatives: @haze/reactions, @haze/select, @haze/combobox.

Dependencies

  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog