Social media share buttons for your next React apps.
๐ Features
No dependencies
Compatible with both JavaScript and TypeScript
Share buttons for your next React app
Facebook
Line
Pinterest
Reddit
Telegram
Tumblr
Twitter
Viber
Weibo
Whatsapp
Linkedin
VKShare
Livejournal
Workplace
Pocket
Instapaper
Hatena
FacebookMessenger
Email
Gab
Share counts
FacebookShareCount
HatenaShareCount
OKShareCount
PinterestShareCount
TumblrShareCount
VKShareCount
๐ง Install
next-share is available on npm. It can be installed with the following command:
npm install next-share --save
next-share is available on yarn as well. It can be installed with the following command:
yarn add next-share --save
๐ก Usage of ShareButton
๐ Facebook
๐จโ๐ป Code
import{FacebookShareButton,FacebookIcon,}from'next-share';<FacebookShareButtonurl={'https://github.com/next-share'}quote={'next-share is a social share buttons for your next React apps.'}hashtag={'#nextshare'}><FacebookIconsize={32}round/></FacebookShareButton>
import{LineShareButton,LineIcon,}from'next-share';<LineShareButtonurl={'https://github.com/next-share'}title={'next-share is a social share buttons for your next React apps.'}><LineIcon/></LineShareButton>
import{PinterestShareButton,PinterestIcon,}from'next-share'<PinterestShareButtonurl={'https://github.com/next-share'}media={'next-share is a social share buttons for your next React apps.'}><PinterestIconsize={32}round/></PinterestShareButton>
import{RedditShareButton,RedditIcon,}from'next-share'<RedditShareButtonurl={'https://github.com/next-share'}title={'next-share is a social share buttons for your next React apps.'}><RedditIconsize={32}round/></RedditShareButton>
import{TelegramShareButton,TelegramIcon,}from'next-share'<TelegramShareButtonurl={'https://github.com/next-share'}title={'next-share is a social share buttons for your next React apps.'}><TelegramIconsize={32}round/></TelegramShareButton>
import{TumblrShareButton,TumblrIcon,}from'next-share'<TumblrShareButtonurl={'https://github.com/next-share'}title={'next-share is a social share buttons for your next React apps.'}><TumblrIconsize={32}round/></TumblrShareButton>
import{TwitterShareButton,TwitterIcon,}from'next-share'<TwitterShareButtonurl={'https://github.com/next-share'}title={'next-share is a social share buttons for your next React apps.'}><TwitterIconsize={32}round/></TwitterShareButton>
import{ViberShareButton,ViberIcon,}from'next-share'<ViberShareButtonurl={'https://github.com/next-share'}title={'next-share is a social share buttons for your next React apps.'}><ViberIconsize={32}round/></ViberShareButton>
import{WeiboShareButton,WeiboIcon,}from'next-share'<WeiboShareButtonurl={'https://github.com/next-share'}title={'next-share is a social share buttons for your next React apps.'}image={`${String(window.location)}/${example-image}`}><WeiboIconsize={32}round/></WeiboShareButton>
import{WhatsappShareButton,WhatsappIcon,}from'next-share'<WhatsappShareButtonurl={'https://github.com/next-share'}title={'next-share is a social share buttons for your next React apps.'}separator=":: "><WhatsappIconsize={32}round/></WhatsappShareButton>
Title of the shared page. Note that if Pocket detects a title tag on the page being saved, this parameter will be ignored and the title tag of the saved page will be used instead.
Update reddit icon color to match current branding
Details changes for each release are documented in the CHANGELOG.md.
๐ Wrap Up
If you think any of the next-share can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.
๐ Contribution
We'd love to have your helping hand on contributions to next-share by forking and sending a pull request!
Your contributions are heartily โก welcome, recognized and appreciated. (โฟโ โฟโ )