-3

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:

1

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?

1

2 Answers 2

1

It exists navigator.share() (link), but in july 2024 its just implemented in safari and edge, not in chrome and Firefox.

0

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/

Not the answer you're looking for? Browse other questions tagged or ask your own question.