sharer.npm.js
v0.0.10
Published
Create custom social share DOM elements. No dependencies.
Downloads
1,002
Maintainers
Readme
Sharer.npm.js
Sharer.npm.js is the node package module for Sharer.js. Checkout the official docs page for more info.
Installing
npm install sharer.npm.js
Usage
(sample using with react)
import Sharer from 'sharer.npm.js';
class Sample extends React.Component {
handleClick(e) {
const sharer = new Sharer(e.target)
sharer.share()
}
render() {
return (
<button
onClick={::this.handleClick}
className='sharer button'
data-sharer='twitter'
data-title='Checkout Sharer.js!'
data-url='https://ellisonleao.github.io/sharer.js/'>
Share on Twitter
</button>
)
}
}