0.0.5 • Published 2 years ago

next-social-sharer v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

next-social-sharer

Forked from https://github.com/Bunlong/next-share

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

💡 Usage

🎀 Facebook

👨‍💻 Code

import {
  FacebookShareButton,
  FacebookIcon,
} from 'next-share';

<FacebookShareButton
  url={'https://github.com/next-share'}
  quote={'next-share is a social share buttons for your next React apps.'}
  hashtag={'#nextshare'}
>
  <FacebookIcon size={32} round />
</FacebookShareButton>

📖 FacebookShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
quotestringA quote to be shared.
hashtagstringHashtag to be shared.
windowWidthnumber550Opened window width.
windowHeightnumber400Opened window height.

📖 FacebookIcon props

🎀 Line

👨‍💻 Code

import {
  LineShareButton,
  LineIcon,
} from 'next-share';

<LineShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <LineIcon />
</LineShareButton>

📖 LineShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
windowWidthnumber500Opened window width.
windowHeightnumber500Opened window height.

📖 LineIcon props

🎀 Pinterest

👨‍💻 Code

import {
  PinterestShareButton,
  PinterestIcon,
} from 'next-share'

<PinterestShareButton
  url={'https://github.com/next-share'}
  media={'next-share is a social share buttons for your next React apps.'}
>
  <PinterestIcon size={32} round />
</PinterestShareButton>

📖 PinterestShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
mediastringThe image URL that will be pinned.
descriptionstringThe description of the shared media.
windowWidthnumber1000Opened window width.
windowHeightnumber730Opened window height.

📖 PinterestIcon props

🎀 Reddit

👨‍💻 Code

import {
  RedditShareButton,
  RedditIcon,
} from 'next-share'

<RedditShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <RedditIcon size={32} round />
</RedditShareButton>

📖 RedditShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
windowWidthnumber660Opened window width.
windowHeightnumber460Opened window height.

📖 RedditIcon props

🎀 Telegram

👨‍💻 Code

import {
  TelegramShareButton,
  TelegramIcon,
} from 'next-share'

<TelegramShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <TelegramIcon size={32} round />
</TelegramShareButton>

📖 TelegramShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
windowWidthnumber550Opened window width.
windowHeightnumber400Opened window height.

📖 TelegramIcon props

🎀 Tumblr

👨‍💻 Code

import {
  TumblrShareButton,
  TumblrIcon,
} from 'next-share'

<TumblrShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <TumblrIcon size={32} round />
</TumblrShareButton>

📖 TumblrShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
tagsArray<string>
captionstringThe description of the shared page.
posttypestringlink
windowWidthnumber660Opened window width.
windowHeightnumber460Opened window height.

📖 TumblrIcon props

🎀 Twitter

👨‍💻 Code

import {
  TwitterShareButton,
  TwitterIcon,
} from 'next-share'

<TwitterShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <TwitterIcon size={32} round />
</TwitterShareButton>

📖 TwitterShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
viastring
hashtagsarray
relatedarray
windowWidthnumber550Opened window width.
windowHeightnumber400Opened window height.

📖 TwitterIcon props

🎀 Viber

👨‍💻 Code

import {
  ViberShareButton,
  ViberIcon,
} from 'next-share'

<ViberShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
>
  <ViberIcon size={32} round />
</ViberShareButton>

📖 ViberShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
separator
windowWidthnumber660Opened window width.
windowHeightnumber460Opened window height.

📖 ViberIcon props

🎀 Weibo

👨‍💻 Code

import {
  WeiboShareButton,
  WeiboIcon,
} from 'next-share'

<WeiboShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
  image={`${String(window.location)}/${example-image}`}
>
  <WeiboIcon size={32} round />
</WeiboShareButton>

📖 WeiboShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
imagestringThe image URL that will be shared.
windowWidthnumber660Opened window width.
windowHeightnumber550Opened window height.

📖 WeiboIcon props

🎀 Whatsapp

👨‍💻 Code

import {
  WhatsappShareButton,
  WhatsappIcon,
} from 'next-share'

<WhatsappShareButton
  url={'https://github.com/next-share'}
  title={'next-share is a social share buttons for your next React apps.'}
  separator=":: "
>
  <WhatsappIcon size={32} round />
</WhatsappShareButton>

📖 WhatsappShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
separatorstring
windowWidthnumber550Opened window width.
windowHeightnumber400Opened window height.

📖 WhatsappIcon props

🎀 Linkedin

👨‍💻 Code

import {
  LinkedinShareButton,
  LinkedinIcon,
} from 'next-share'

<LinkedinShareButton url={'https://github.com/next-share'}>
  <LinkedinIcon size={32} round />
</LinkedinShareButton>

📖 LinkedinShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
summarystringDescription of the shared page.
sourcestringSource of the content (e.g. your website or application name).
windowWidthnumber750Opened window width.
windowHeightnumber600Opened window height.

📖 LinkedinIcon props

🎀 VK

👨‍💻 Code

import {
  VKShareButton,
  VKIcon,
} from 'next-share'

<VKShareButton
  url={'https://github.com/next-share'}
  image={'./next-share.png'}
>
  <VKIcon size={32} round />
</VKShareButton>

📖 VKShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
imagestringAn absolute link to the image that will be shared.
noParsebooleanIf true is passed, VK will not retrieve URL information.
noVkLinksbooleanIf true is passed, there will be no links to the user's profile in the open window. Only for mobile devices.
windowWidthnumber660Opened window width.
windowHeightnumber460Opened window height.

📖 VKIcon props

🎀 Mailru

👨‍💻 Code

import {
  MailruShareButton,
  MailruIcon,
} from 'next-share'

<MailruShareButton
  url={'https://github.com/next-share'}
  title={'Next Share'}
>
  <MailruIcon size={32} round />
</MailruShareButton>

📖 MailruShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
descriptionstringDescription of the shared page.
imageUrlstringImage url of the shared page.
windowWidthnumber660Opened window width.
windowHeightnumber460Opened window height.

📖 MailruIcon props

🎀 Livejournal

👨‍💻 Code

import {
  LivejournalShareButton,
  LivejournalIcon,
} from 'next-share'

<LivejournalShareButton
  url={'https://github.com/next-share'}
  title={'Next Share'}
  description={'https://github.com/next-share'}
>
  <LivejournalIcon size={32} round />
</LivejournalShareButton>

📖 LivejournalShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringThe title of the shared page.
descriptionstringDescription of the shared page.
windowWidthnumber660Opened window width.
windowHeightnumber460Opened window height.

📖 LivejournalIcon props

🎀 Workplace

👨‍💻 Code

import {
  WorkplaceShareButton,
  WorkplaceIcon,
} from 'next-share'

<WorkplaceShareButton
  url={'https://github.com/next-share'}
  quote={'Next Share'}
>
  <WorkplaceIcon size={32} round />
</WorkplaceShareButton>

📖 WorkplaceShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
quotestring
hashtagstring
windowWidthnumber550Opened window width.
windowHeightnumber400Opened window height.

📖 WorkplaceIcon props

🎀 Pocket

👨‍💻 Code

import {
  PocketShareButton,
  PocketIcon,
} from 'next-share'

<PocketShareButton
  url={'https://github.com/next-share'}
  title={'Next Share'}
>
  <PocketIcon size={32} round />
</PocketShareButton>

📖 PocketShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringTitle 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.
windowWidthnumber500Opened window width.
windowHeightnumber500Opened window height.

📖 PocketIcon props

🎀 Instapaper

👨‍💻 Code

import {
  InstapaperShareButton,
  InstapaperIcon,
} from 'next-share'

<InstapaperShareButton
  url={'https://github.com/next-share'}
  title={'Next Share'}
>
  <InstapaperIcon size={32} round />
</InstapaperShareButton>

📖 InstapaperShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringTitle of the shared page.
descriptionstringDescription of the shared page.
windowWidthnumber500Opened window width.
windowHeightnumber500Opened window height.

📖 InstapaperIcon props

🎀 Hatena

👨‍💻 Code

import {
  HatenaShareButton,
  HatenaIcon,
} from 'next-share'

<HatenaShareButton
  url={'https://github.com/next-share'}
  title={'Next Share'}
>
  <HatenaIcon size={32} round />
</HatenaShareButton>

📖 HatenaShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
titlestringTitle of the shared page.
windowWidthnumber660Opened window width.
windowHeightnumber460Opened window height.

📖 HatenaIcon props

🎀 FacebookMessenger

👨‍💻 Code

import {
  FacebookMessengerShareButton,
  FacebookMessengerIcon,
} from 'next-share'

<FacebookMessengerShareButton
  url={'https://github.com/next-share'}
  appId={''}
>
  <FacebookMessengerIcon size={32} round />
</FacebookMessengerShareButton>

📖 FacebookMessengerShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
appIdstringFacebook application id.
redirectUristringThe URL to redirect to after sharing (default: the shared url).
tostringA user ID of a recipient. Once the dialog comes up, the sender can specify additional people as recipients.
windowWidthnumber1000Opened window width.
windowHeightnumber820Opened window height.

📖 FacebookMessengerIcon props

🎀 Email

👨‍💻 Code

import {
  EmailShareButton,
  EmailIcon,
} from 'next-share'

<EmailShareButton
  url={'https://github.com/next-share'}
  subject={'Next Share'}
  body="body"
>
  <EmailIcon size={32} round />
</EmailShareButton>

📖 EmailShareButton props

PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.
urlstringThe URL of the shared page.
subjectstring
bodystring
separatorstring

📖 EmailIcon props

📚 Icons props

PropsTypeDefaultDescriptionRequired
sizenumberIcon size in pixels.
roundbooleanShow round or rectangle.
borderRadiusnumberSet rounded corners if using round icon.
bgStyleobjectCustomize background style.
iconFillColorstringwhiteCustomize icon fill color.

📜 Changelog

Changes in each release are documented in the CHANGELOG.md.

⚖️ License

The MIT License License: MIT