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

sunnysingh/socialshares

Repository files navigation

Socialshares

Socialshares v3. Work in progress.

View npm package MIT License Follow on Twitter

⚡️ 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.

🔌 Integrations

Socialshares works well with React and provides the @socialshares/react package for a seamless integration.


💻 Development

  1. Install dependencies: npm install
  2. Bootstrap packages: npm run bootstrap
  3. Open core package: cd packages/core
  4. Launch watcher and demo: npm run dev

🚀 Distributing

  1. Log in to npm: npm login
  2. Install dependencies: npm run bootstrap
  3. 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

👥 Credits