Adds support to PicMo for showing a picker in a popup element.
Requires the base PicMo package to be installed as a peer dependency.
Installation
npm install @picmo/popup-picker
Basic usage
To show a popup picker, you'll need a trigger element. This is often a button or other clickable element that can show the popup picker in response to a click event.
import { createPopup } from '@picmo/popup-picker';
const triggerButton = document.querySelector('#emoji-button');
const picker = createPopup({}, {
triggerElement: triggerButton,
referenceElement: triggerButton,
position: 'bottom-start'
});
picker.addEventListener('emoji:select', event => {
console.log('Emoji selected:', event.emoji);
});