
A JavaScript plugin that adds a popup menu to text selections just you seen on Medium.com. Typical use cases for this application include text editor, share sharing and more.
See also:
- Medium Style Text Selection Sharing Library – share-this
- Medium Inspired Floating Popup For Selected Text – WebClip
- Medium Style Inline Rich Text Editor – Medium Editor
- Share Selected Text On Twitter And Facebook – sharect.js
Installation:
# NPM $ npm install selection-popup --save
Import the library
// ES 2015
import selectionPopup from 'selection-popup';
// CommonJS:
const selectionPopup = require('selection-popup');Basic usage:
- items: menu items
- callbacks: click callbacks for items
- options: options array
selectionPopup(items, callbacks, options)
Add your own styles:
selectionPopup(items, callbacks, {
{style: 'background-color:#222'}
})






