Installation
There are two recommended methods for installing the share button. Use the first installation method you're using a bundler to compile your code and the second when you're dropping a script on your page.
Install via NPM
Useful when...
- Install the package
bash
npm install @royalfig/share-button
- Import the package
js
import "@royalfig/share-button";
Use the latest release v1.0.26
Download the latest release and copy the code into your site.
Use with Ghost
To load the share button on a Ghost site, use the latest release method above.
Specifically, open Settings → Code Injection. In the Site Header, add a script
tag and paste in the code from the previous step.
Then, you can use an HTML card and the <share-button></share-button>
element anywhere in your post.
If you want a button that floats on any page, add the share button to Code Injection → Site Footer with the position
attribute.
html
<share-button position="left"></share-button>