Skip to content
Alea0.1
Pro
  1. Alea
  2. Components
  3. Forms
  4. EmojiPicker

Forms

EmojiPicker

Pick an emoji: search by name in English or Spanish, jump by category, recent picks first, and a grid you move through with the arrow keys.

import { EmojiPicker } from '@alea/ui';

Examples

EmojiPicker

Search in English or Spanish ("heart", "corazรณn"), jump with the category row, move with the arrows and pick with Enter. Your picks show first next time.

Nothing picked yet

In a popover

The usual place for it: a button that says what it does opens the picker next to it, and picking closes it.

Tokens

The design tokens this component reads, with their value in the current theme. Override any of them to restyle it.

Color

  • --alea-borderโ€ฆ
  • --alea-focusโ€ฆ
  • --alea-surfaceโ€ฆ
  • --alea-surface-hoverโ€ฆ
  • --alea-text-mutedโ€ฆ

Space

  • --alea-space-1โ€ฆ
  • --alea-space-2โ€ฆ
  • --alea-space-6โ€ฆ

Radius

  • --alea-radius-smโ€ฆ

Type

  • --alea-font-family-bodyโ€ฆ
  • --alea-font-size-smโ€ฆ
  • --alea-font-size-xsโ€ฆ
  • --alea-font-weight-semiboldโ€ฆ

Motion

  • --alea-motion-duration-fastโ€ฆ
  • --alea-motion-ease-emphasizedโ€ฆ

Component

  • --alea-emoji-colsโ€ฆ

Props

EmojiPicker props

Pick an emoji: search by name (English or Spanish), jump by category, recent picks first. The grid is a listbox in a grid layout: arrows move in two directions, Enter picks, and every emoji has a name for screen readers.

PropTypeDefaultDescription
onSelectrequired(emoji: string, name: string) => void-Called with the picked emoji and its name.
autoFocusSearchbooleantruePuts the cursor in the search field when it opens. Default true.
classNamestring-Extra class names.
columnsnumber8Columns in the grid. Default 8.
heightnumber280Height of the scrolling grid in px. Default 280.
showRecentbooleantrueRemembers the last picks (in this browser) and shows them first. Default true.

Specs

Generated from the source: the variants in the types, the states and tokens in the CSS, and the motion patterns that apply. The grids render the real component in both themes; the numbers are measured from the page.

States
Hover (CSS)HoverKeyboard focusPressed
Dark and light
Every color comes from theme tokens, so it follows data-theme (and presets like Graphite) on the page or any wrapper. Contrast is checked in both themes.
Styling hooks
.alea-emoji.alea-emoji-cats.alea-emoji-cat.alea-emoji-scroll.alea-emoji-empty.alea-emoji-grid.alea-emoji-section.alea-emoji-header.alea-emoji-item

Accessibility

  • The grid is a listbox in a grid layout: arrows move in two directions, Enter picks.
  • Every emoji has a name (in the language of the page), so screen readers say "thumbs up", not the character.
  • The category buttons are named and move the grid to their section; search results replace the sections.
  • When nothing matches, a status says so.

Keyboard

KeyDoes
Arrow keysMove through the grid
EnterPicks the emoji
TabMoves between the search, the categories and the grid

Do and don't

Do

  • Open it in a Popover next to what it adds to (a reaction, a message, a page icon).
  • Keep recent picks on: people reuse the same few emoji.

Don't

  • Don't use emoji as the only way to say something important.
  • Don't open it without a trigger that says what it does ("Add reaction").

In Figma

EmojiPicker with the search, the category row and a grid of emoji.

Tested with axe, keyboard and screen reader roles