0.0.3 • Published 8 years ago
simple-share-buttons v0.0.3
Simple Share Button
Simple Share Button is a simple javascript function to share you content.
Installation
Download zip files
Download ZIP files here and unzip it in your project.
Use bower
You can use bower to install the plugin.
bower install --save simple-share-button
After that, reference the JavaScript file:
<script src="bower_components/simple-share-button/src/share-button.js"></script>
<!-- OR -->
<script src="your_library_folder/simple-share-button/src/share-button.js"></script>
Use NPM
npm i simple-share-buttons -S
const share = require('simple-share-buttons');
Usage
To use it, use the following markup:
<a href="your_link" class="btn-share" data-social="twitter">Share on Twitter</a>
<button class="btn-share" data-url="your_link" data-social="twitter">Share on Twitter</button>
data attributes | Role | Comment |
---|---|---|
data-social | Name of social network | require |
data-url | Url of the page to share | not require - If is not specify, the current page url is used |
data-via | Your username | not require - Just for Twitter |
List of available social network
- google plus
If you want new social network or more options, make a pull request.
TO-DO
- Add demo page
- Add more social networks