Use this web component to add a button for sharing the current page to social media (Twitter/X, Facebook, LinkedIn) or copying the URL.
There are two ways to add your share button to the page.
- Use the CDN
Add the following script tag to your head.
<script defer src="https://unpkg.com/@royalfig/share-button/dist/share-button.umd.js"></script>
- Install with NPM
npm install @royalfig/share-button
For customization and advanced usage, see the official docs