I would like to implement a general share button that opens the OS menu where you can then share the post.
I’ve only seen this on mobile apps so far, but not on websites. Is it possible to add this to a website?
If you don’t know what i mean, here is following screenshot:
So for example i want to click on a button, and then this menu should open.
Is it possible? If yes, how would one implement this?
2
Answers
It exists
navigator.share()
(link), but in july 2024 its just implemented in safari and edge, not in chrome and Firefox.use navigator.share();
Web Docs: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share
navigator.share() Browser Support Matrix
Shoutout to css-tricks for a great tutorial:
https://css-tricks.com/how-to-use-the-web-share-api/