Skip to content

dango0812/social-share-urls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 

Repository files navigation

Social Share Urls

This project is intended to help you integrate sharing on social media within web environment.

It provides a collection of social media share URLs and corresponding icons to easily implement share functionality across popular platforms.

Why install a full library when you only need to support two share services?

You don’t need a massive library just to add simple social sharing!

Keep it light skip the heavy libraries and just use simple share URLs.

📱 Supported Social Networks

Platform Share URL Details Icons
Threads https://threads.net/intent/post Link Link
Twitter (X) https://twitter.com/intent/tweet Link Link
Reddit https://www.reddit.com/submit Link Link
Facebook https://www.facebook.com/sharer.php Link Link
Facebook Messenger https://www.facebook.com/dialog/send Link Link
Telegram https://t.me/share Link Link
WhatsApp https://api.whatsapp.com/send Link Link
Tumblr http://tumblr.com/widgets/share Link Link
LinkedIn https://www.linkedin.com/feed Link Link
VK (ВКонтакте) https://vk.com/share.php Link Link
Pinterest https://pinterest.com/pin/create/button/ Link Link
Instapaper http://www.instapaper.com/hello2 Link Link
Email mailto: Link Link
Instagram
TikTok
YouTube

✍️ How to use

Embed example

const searchParams = new URLSearchParams({
    url: "https://github.com/dango0812", // share url
    text: "hello, world"
});
const shareUrl = `https://twitter.com/intent/tweet?${searchParams.toString()}`;

<a href={shareUrl} target="_blank" rel="noopener noreferrer">
    twitter share!
</a>

Using a function example

const handleTwitterShare = () => {
    const searchParams = new URLSearchParams({
        url: "https://github.com/dango0812", // share url
        text: "hello, world"
    });
    const shareUrl = `https://twitter.com/intent/tweet?${searchParams.toString()}`;

    window.open(shareUrl, "_blank", "width=800,height=640,noopenner,noreferrer");
};

<button onClick={handleTwitterShare}>
    twitter share!
</button>

Hits

About

This project is intended to help you integrate sharing on social media within web environment 🌐

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published