@socialshares/core
v0.0.22
Published
Social share buttons
Downloads
19
Maintainers
Readme
⚡️ Quick start
<div id="shareButtons"></div>
<script type="module">
import {
renderShareButtons,
twitterButton,
facebookButton,
} from '//unpkg.com/@socialshares/core?module';
const mountElement = document.getElementById('shareButtons');
renderShareButtons(mountElement, [twitterButton(), facebookButton()]);
</script>
📦 Install
You can install via npm:
npm install @socialshares/core
Then import with a bundler like Parcel or Webpack:
import {
renderShareButtons,
twitterButton,
facebookButton,
} from '@socialshares/core';
const mountElement = document.getElementById('shareButtons');
renderShareButtons(mountElement, [twitterButton(), facebookButton()]);
Make sure to add an empty element to your HTML:
<div id="shareButtons"></div>
Done! You should see a Tweet button and Facebook button rendered.
Check out the socialshares docs for more.