Maya
The release is out — thanks, everyone!
A searchable emoji picker, assembled from parts: one scrolling list of every category with sticky headers — virtualised — through which the arrow keys move from the search field, skin tones, the emojis' names in 28 languages, and the emojis the system can't draw left out. Modelled on Frimousse; the data is Emojibase's (below), bundled with your app.
It has its own entry point, @semantic-components/ui/emoji-picker, built on emojibase-data — an optional peer of ui: install it where you use the component.
import { ScEmojiPicker, ScEmojiPickerSearch, ScEmojiPickerViewport, ScEmojiPickerList } from '@semantic-components/ui/emoji-picker';import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScFrame, ScSpinner } from '@semantic-components/ui';import { type ScEmoji, ScEmojiPicker, ScEmojiPickerAnnouncer, ScEmojiPickerEmpty, ScEmojiPickerError, ScEmojiPickerFooter, ScEmojiPickerList,The picker holds the data, the search and the active emoji; the list draws the emojis — only the rows in view — under their categories. The rest is yours: the search field's icon, the states' text, a footer with a preview and a skin tone, a category toolbar — parts on your elements.
import { ScEmojiPicker, ScEmojiPickerSearchField, ScEmojiPickerSearch, ScEmojiPickerViewport, ScEmojiPickerLoading, ScEmojiPickerEmpty, ScEmojiPickerError, ScEmojiPickerAnnouncer, ScEmojiPickerList, ScEmojiPickerFooter, ScEmojiPickerPreview, ScEmojiPickerSkinTone,} from '@semantic-components/ui/emoji-picker';<div scEmojiPicker> <div scEmojiPickerSearchField> <input scEmojiPickerSearch aria-label="…" /> </div> <div scEmojiPickerViewport> <span scEmojiPickerLoading>…</span> <span scEmojiPickerEmpty>…</span> <span scEmojiPickerError>…</span> <span scEmojiPickerAnnouncer></span> <div scEmojiPickerList aria-label="…"></div> </div> <div scEmojiPickerFooter> <div scEmojiPickerPreview>…</div> <button scEmojiPickerSkinTone>…</button> </div></div>LOCALE_ID: the app's, or one provided for a section): 28 languages; English for the others. emojibase-data. emojiVersion sets the newest version yourself. data (an ScEmojiData); loadEmojiData(locale) gives Emojibase's, outside a picker. scEmojiPickerAnnouncer, a hidden live region. In a popover, opened by your button: the search field takes focus, and a pick closes it (closeOnPick; false keeps it open for more).
import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScButton, ScPopover, ScPopoverPortal, ScPopoverProvider, ScPopoverTrigger, ScSpinner,} from '@semantic-components/ui';import { A category toolbar with your icons, and the recent emojis first — keep recent (in localStorage, say) to restore them.
import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScFrame, ScSpinner } from '@semantic-components/ui';import { type ScEmoji, ScEmojiPicker, ScEmojiPickerAnnouncer, ScEmojiPickerCategoryButton, ScEmojiPickerCategoryNav, ScEmojiPickerEmpty, ScEmojiPickerError, In another language: the emojis' names and the search follow LOCALE_ID, provided for the section; your text is yours to translate. A skin tone applies to the whole list.
import { Component, LOCALE_ID, ViewEncapsulation, signal } from '@angular/core';import { ScFrame, ScSpinner } from '@semantic-components/ui';import { ScEmojiPicker, ScEmojiPickerAnnouncer, ScEmojiPickerEmpty, ScEmojiPickerError, ScEmojiPickerFooter, ScEmojiPickerList, ScEmojiPickerLoading, Just the list: fewer columns (columns), no search, no footer.
import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScFrame, ScSpinner } from '@semantic-components/ui';import { type ScEmoji, ScEmojiPicker, ScEmojiPickerError, ScEmojiPickerList, ScEmojiPickerLoading, ScEmojiPickerViewport,} from '@semantic-components/ui/emoji-picker'; Into a message: with insertInto, the emoji goes in at the caret, the form value follows, and focus is back in the field after it.
Value: —
import { CdkOverlayOrigin } from '@angular/cdk/overlay';import { Component, ViewEncapsulation, signal } from '@angular/core';import { FormField, form } from '@angular/forms/signals';import { ScButton, ScInput, ScInputGroup, ScInputGroupAddon, ScPopover, ScPopoverPortal,Reactions: a few quick ones, the rest from the picker. A reaction is a toggle — yours or not — with its count.
Maya
The release is out — thanks, everyone!
import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScButton, ScFrame, ScPopover, ScPopoverPortal, ScPopoverProvider, ScPopoverTrigger, ScSpinner, ScToggle, Your own emojis (data): a team's set, with its categories, names and search words. The picker works the same.
import { Component, ViewEncapsulation, signal } from '@angular/core';import { ScFrame } from '@semantic-components/ui';import { type ScEmoji, type ScEmojiData, type ScEmojiDataEmoji, ScEmojiPicker, ScEmojiPickerAnnouncer, ScEmojiPickerEmpty, ScEmojiPickerFooter,Right to left: the rows, the category toolbar and the arrow keys run from the right. Emojibase has no Arabic, so the emojis' names are in English.
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation, signal } from '@angular/core';import { ScFrame, ScSpinner } from '@semantic-components/ui';import { type ScEmoji, ScEmojiPicker, ScEmojiPickerAnnouncer, ScEmojiPickerCategoryButton, ScEmojiPickerCategoryNav, ScEmojiPickerEmpty, Each part takes class, merged over its look (cn: a later class wins). The skin-tone button is the style's button and the category buttons its toggle: pick another look with variant and size.
| Input | Type | Default | Description |
|---|---|---|---|
columns | number | 10 | Emojis per row. |
skinTone | ScEmojiSkinTone | 'none' | Two-way: the tone emojis are shown in ('light', 'medium-light', 'medium', 'medium-dark', 'dark'). |
emojiVersion | number | null | null | The newest Emoji version shown; by default the newest the system draws. |
data | ScEmojiData | null | null | Your emojis instead of Emojibase's. |
sticky | boolean | true | Category headers stick while their emojis scroll. |
recent | ScEmoji[] | [] | Two-way: the recently picked emojis, latest first — keep them to restore them. |
maxRecent | number | 20 | How many recent emojis are kept. |
recentLabel | string | null | null | The name of a first category of the recent emojis; none without it. |
closeOnPick | boolean | true | In a popover, a pick closes it; false: it stays open for more. |
insertInto | HTMLInputElement | HTMLTextAreaElement | null | null | Your text field: a pick goes in at its caret, its value follows (an input event), focus is back in it. |
(emojiSelect) | ScEmoji | — | An emoji was picked: { emoji, label }. |
| Part | Selector | Description |
|---|---|---|
ScEmojiPicker | div[scEmojiPicker] | The picker (#picker="scEmojiPicker"): categories() for a toolbar, skinToneNames(), activeEmoji(), loading(), failed(), empty(), search(); focus(), scrollToCategory(i), nextSkinTone(). |
ScEmojiPickerSearchField | div[scEmojiPickerSearchField] | The search row: your icon, then the field. |
ScEmojiPickerSearch | input[scEmojiPickerSearch] | Filters as you type (names, then keywords); the first result becomes active. Name it. |
ScEmojiPickerViewport | div[scEmojiPickerViewport] | The scrolling frame; focusable, so the arrows work from it too. |
ScEmojiPickerList | div[scEmojiPickerList] | The grid: draws the emojis — only the rows in view — under their categories, whose headers stick. Name it. |
| Part | Selector | Description |
|---|---|---|
ScEmojiPickerLoading | [scEmojiPickerLoading] | Shown while the data loads. |
ScEmojiPickerEmpty | [scEmojiPickerEmpty] | Shown when nothing matches (#empty="scEmojiPickerEmpty": search() for your text). |
ScEmojiPickerError | [scEmojiPickerError] | Shown (an alert) when the data couldn't be loaded. |
ScEmojiPickerAnnouncer | [scEmojiPickerAnnouncer] | A hidden live region: says the emoji moved to with the keyboard. |
| Part | Selector | Description |
|---|---|---|
ScEmojiPickerFooter | div[scEmojiPickerFooter] | A row under the list, as wide as it. |
ScEmojiPickerPreview | div[scEmojiPickerPreview] | The emoji hovered or moved to and its name; your text (Select an emoji…) while there's none. |
ScEmojiPickerSkinTone | button[scEmojiPickerSkinTone] | Cycles the skin tone; write variation() — ✋, or your emoji (scEmojiPickerSkinTone="👍"), in the tone. Name it. |
ScEmojiPickerCategoryNav | div[scEmojiPickerCategoryNav] | A toolbar of category buttons: one Tab stop, the arrow keys. Name it. |
ScEmojiPickerCategoryButton | button[scEmojiPickerCategoryButton]="category" | Scrolls to the category (picker.categories()), pressed while it is at the top, named by it. Write its icon (category.key). |