Positioning

Relative positioning

Emoji Button uses the Popper library for relative positioning of the picker. The picker accepts a position option specifying where the picker should be positioned, relative to the reference element passed to showPicker or togglePicker. This property can be any of the Placement properties defined in the Popper documentation.

import { EmojiButton } from '@joeattardi/emoji-button';

const picker = new EmojiButton({
  position: 'bottom-start'
});

Fixed positioning

A fixed position can also be given for the position option. In this case, position is an object with top, bottom, left, and/or right properties. Only one is required.

import { EmojiButton } from '@joeattardi/emoji-button';

const picker = new EmojiButton({
  position: {
    top: '0',
    right: '0'
  }
});