Pure
Structure

Share URL

Share a URL with the Web Share API (if available) and copying to the clipboard. On share success it updates the button text and maintains its size after update. Available as a JS plugin or a HTML Web Component and you can see it in action in the footer of this very site!

Install with npm $ npm install @nigelotoole/share-url --save-dev, import the JS into your project, add the elements to your HTML and initialize the plugin if needed.

Inspired by How to let the user share the website they are on by Thomas Steiner and webcare-webshare Web Component by Zach Leatherman, HTML web components by Jeremy Keith and HTML web components by Jim Nielsen.