Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages β the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages β the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
Accessible emoji picker with search, category tabs, and target insertion. Browse, search, or select emoji and insert directly into inputs, textareas, or contenteditable elements.
The <emoji-picker> component provides an accessible popup for browsing, searching, and selecting emoji. It can insert directly into a target input, textarea, or contenteditable element, or dispatch events for custom handling.
<textarea id="msg" rows="3"></textarea><emoji-picker for="msg"> <button data-trigger type="button">π</button></emoji-picker>
| Attribute | Type | Default | Description |
|---|---|---|---|
for |
string | β | ID of target input, textarea, or contenteditable element for insertion. |
open |
boolean | β | Reflected state attribute set by open()/close() methods. Not intended as initial markup. |
recent-limit |
number | 24 |
Maximum number of recently used emoji to store. |
| Event | Detail | Description |
|---|---|---|
emoji-picker:select |
{ shortcode, emoji, name, keywords } |
Fired when an emoji is selected. |
emoji-picker:open |
β | Fired when the picker panel opens. |
emoji-picker:close |
β | Fired when the picker panel closes. |
const picker = document.querySelector('emoji-picker'); picker.addEventListener('emoji-picker:select', (e) => { console.log(e.detail.emoji); // "π" console.log(e.detail.shortcode); // "rocket" console.log(e.detail.name); // "Rocket"});
Provide your own trigger button as a child element with data-trigger. If no trigger is found, one is auto-created.
<emoji-picker for="comment"> <button data-trigger type="button" aria-label="Add emoji"> Add Emoji </button></emoji-picker>
Omit the for attribute to use the picker without auto-insertion. Listen for the emoji-picker:select event and handle insertion yourself.
<!-- No "for" attribute β handle insertion yourself --><emoji-picker> <button data-trigger type="button">π</button></emoji-picker> <script>document.querySelector('emoji-picker') .addEventListener('emoji-picker:select', (e) => { // Insert wherever you want myEditor.insert(e.detail.emoji); });</script>
| Key | Context | Action |
|---|---|---|
| Enter / Space | Trigger | Toggle picker open/close |
| Escape | Any | Close picker, return focus to trigger |
| Arrow Down | Search input | Move focus to first emoji in grid |
| Arrow Up | Grid (first row) | Return focus to search input |
| Arrow keys | Grid | Navigate between emoji (8-column grid) |
| Home / End | Grid | Jump to first/last emoji |
| Enter / Space | Grid | Select focused emoji |
| Tab | Grid | Close picker |
Selected emoji are stored in localStorage (key: vb-emoji-recent) and shown as a βRecently Usedβ section at the top of the grid. The recent-limit attribute controls how many are kept.
Without JavaScript, the trigger button remains visible but non-functional. The picker panel is hidden by default. Users can still type emoji directly using their OS emoji keyboard (Cmd+Ctrl+Space on macOS, Win+. on Windows).
role="dialog" with a descriptive label.role="tablist" / role="tab".role="grid" / role="gridcell".title with the emoji name and shortcode.data-emoji AttributeThe data-emoji attribute provides a complementary approach β replacing :shortcode: text patterns with emoji characters:
data-emoji to any container to replace shortcodes in text nodes on load.data-emoji to a <textarea> or <input> for live replacement as the user types.Use emoji-picker when users need to browse and discover emoji. Use data-emoji when users already know the shortcode they want to type.