DEV Community

Cover image for Stop searching through old docs for social share urls — get all the latest, ready-to-use URLs right here.
dango0812
dango0812

Posted on

Stop searching through old docs for social share urls — get all the latest, ready-to-use URLs right here.

Are you building a blog, portfolio, or product site and want users to share your content on social media?

Instead of digging through outdated docs or guessing URL formats, I built a simple solution — a collection of ready-to-use social share URLs with corresponding icons (SVG, PNG, JPG).

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.

You can check it out here.
👉 Github: https://github.com/dango0812/social-share-urls
The details documentation is still a work in progress!

💡 How to Use

// Example: Share on Twitter
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>
Enter fullscreen mode Exit fullscreen mode

Since each platform has different URL templates, we've organized them all in this project.
You can copy them and use them right away!

Top comments (0)