Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-emoji-picker>

@methane-ui/ui~11.2 KB brotli (cold + Lit)~3.8 KB marginal

Accessible emoji picker with keyword search, categories, skin tones, recent history, and 2D roving focus.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-emoji-picker> (@methane-ui/ui)
Ready · interact with <mth-emoji-picker>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/emoji-picker"></script>
<mth-emoji-picker columns="6" skin-tone="0"></mth-emoji-picker>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Currently selected emoji string.
labellabelstring""Accessible label for the picker trigger and panel.
inlineinlinebooleanfalseRenders the picker panel inline instead of a trigger-backed popover.
openopenbooleanfalseControls whether the popover panel is open when inline is false.
disableddisabledbooleanfalseDisables interaction with trigger and picker controls.
columnscolumnsnumber6Number of grid columns used for 2D arrow-key navigation.
skinToneskin-tonenumber0Active Fitzpatrick skin tone modifier index (0 = default, 1-5 = tones).
recentLimitrecent-limitnumber12Maximum number of recently picked emojis retained.
emojis—ReadonlyArray<unknown> | nullnullOptional custom emoji dataset overriding the built-in curated set.

Events

EventDetail TypeDescription
mth-select{ emoji: string; name: string; category: string }Fired when an emoji is picked from the grid.
mth-change{ value: string }Fired when the selected emoji value changes.
mth-openundefinedCancelable event fired before opening the popover.
mth-after-openundefinedFired after the popover opens.
mth-closeundefinedCancelable event fired before closing the popover.
mth-after-closeundefinedFired after the popover closes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowLeft / ArrowRight / ArrowUp / ArrowDownbothemoji grid focusedmoves focus across emoji grid cells (RTL-aware)
Home / Endbothemoji grid focusedmoves focus to first or last emoji in grid
Enter / Spacebothemoji button focusedselects emoji and fires mth-select
Escapebothpopover mode opencloses picker popover and restores focus

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 4 APG keyboard transitions across LTR/RTL.mth-emoji-picker.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(open), :state(disabled).Conformance suite
i18nRoutes 10 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test