Skip to content
This repository has been archived by the owner on Jan 9, 2022. It is now read-only.

Latest commit

 

History

History
38 lines (30 loc) · 871 Bytes

README.md

File metadata and controls

38 lines (30 loc) · 871 Bytes

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>
    )
  }
}