Socialshares v3. Work in progress.
<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>
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.
Socialshares works well with React and provides the @socialshares/react package for a seamless integration.
- Install dependencies:
npm install
- Bootstrap packages:
npm run bootstrap
- Open core package:
cd packages/core
- Launch watcher and demo:
npm run dev
- Log in to npm:
npm login
- Install dependencies:
npm run bootstrap
- Publish packages:
npm run publish
If a package was unchanged but you need to force publish a version anyway, try:
npm run publish -- --force-publish
- Monorepo managed with Lerna
- Package bundled with Microbundle
- Icons from Simple Icons
- Demos styled with MVP.css and Prism