πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Sign inDemoInstall
Socket

react-share-kit

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-share-kit

Social media share buttons and share counts for React and Nextjs.

0.1.10
Source
npm
Version published
Weekly downloads
1.2K
-10.63%
Maintainers
1
Weekly downloads
Β 
Created
Source

React-Share-Kit

React-Share-Kit is a simple and easy-to-use library for adding social media share buttons to your React & Next applications. With React-Share-Kit, you can quickly integrate share buttons for popular social media platforms such as Facebook, Twitter, LinkedIn, and more.

Table of Contents

Installation

To install React-Share-Kit, simply run:

npm install react-share-kit

or

yarn add react-share-kit

πŸ’‘ Usage of ShareButtons

Facebook

πŸ‘¨β€πŸ’» Code

import {
  FacebookShareButton
} from 'react-share-kit'

<FacebookShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  quote={'react-share-kit is a social share buttons for your next React apps.'}
  hashtag={'#ReachShareKit'}
  round
/>

πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Line

πŸ‘¨β€πŸ’» Code

import {
  LineShareButton
} from 'next-share-kit'

<LineShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'next-share-kit is a social share buttons for your next React apps.'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Pinterest

πŸ‘¨β€πŸ’» Code

import {
  PinterestShareButton
} from 'next-share-kit'

<PinterestShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  media={'next-share-kit is a social share buttons for your next React apps.'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestring64pxThe title of button used instead of icon.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Reddit

πŸ‘¨β€πŸ’» Code

import {
  RedditShareButton
} from 'next-share-kit'

<RedditShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'next-share-kit is a social share buttons for your next React apps.'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Telegram

πŸ‘¨β€πŸ’» Code

import {
  TelegramShareButton
} from 'next-share-kit'

<TelegramShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'next-share-kit is a social share buttons for your next React apps.'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Tumblr

πŸ‘¨β€πŸ’» Code

import {
  TumblrShareButton
} from 'next-share-kit'

<TumblrShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'next-share-kit is a social share buttons for your next React apps.'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Twitter

πŸ‘¨β€πŸ’» Code

import {
  TwitterShareButton
} from 'next-share-kit'

<TwitterShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'next-share-kit is a social share buttons for your next React apps.'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Viber

πŸ‘¨β€πŸ’» Code

import {
  ViberShareButton
} from 'next-share-kit'

<ViberShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'next-share-kit is a social share buttons for your next React apps.'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Weibo

πŸ‘¨β€πŸ’» Code

import {
  WeiboShareButton
} from 'next-share-kit'

<WeiboShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'next-share-kit is a social share buttons for your next React apps.'}
  image={`${String(window.location)}/${example-image}`}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Whatsapp

πŸ‘¨β€πŸ’» Code

import {
  WhatsappShareButton
} from 'next-share-kit'

<WhatsappShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'next-share-kit is a social share buttons for your next React apps.'}
  separator=":: "
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Linkedin

πŸ‘¨β€πŸ’» Code

import {
  LinkedinShareButton
} from 'next-share-kit'

<LinkedinShareButton url={'https://github.com/ayda-tech/react-share-kit'} />
πŸ“– Props
PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.βœ…
urlstringThe URL of the shared page.βœ…
windowWidthnumber750Opened window width.❌
windowHeightnumber600Opened window height.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

VK

πŸ‘¨β€πŸ’» Code

import {
  VKShareButton
} from 'next-share-kit'

<VKShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  image={'./next-share.png'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Mailru

πŸ‘¨β€πŸ’» Code

import {
  MailruShareButton
} from 'next-share-kit'

<MailruShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'Next Share'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Livejournal

πŸ‘¨β€πŸ’» Code

import {
  LivejournalShareButton
} from 'next-share-kit'

<LivejournalShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'Next Share'}
  description={'https://github.com/ayda-tech/react-share-kit'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Workplace

πŸ‘¨β€πŸ’» Code

import {
  WorkplaceShareButton
} from 'next-share-kit'

<WorkplaceShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  quote={'Next Share'}
/>
πŸ“– Props
PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.βœ…
urlstringThe URL of the shared page.βœ…
quotestring❌
hashtagstring❌
windowWidthnumber550Opened window width.❌
windowHeightnumber400Opened window height.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Pocket

πŸ‘¨β€πŸ’» Code

import {
  PocketShareButton
} from 'next-share-kit'

<PocketShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'Next Share'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Instapaper

πŸ‘¨β€πŸ’» Code

import {
  InstapaperShareButton
} from 'next-share-kit'

<InstapaperShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'Next Share'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Hatena

πŸ‘¨β€πŸ’» Code

import {
  HatenaShareButton
} from 'next-share-kit'

<HatenaShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'Next Share'}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

FacebookMessenger

πŸ‘¨β€πŸ’» Code

import {
  FacebookMessengerShareButton
} from 'next-share-kit'

<FacebookMessengerShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  appId={''}
/>
πŸ“– 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.❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Email

πŸ‘¨β€πŸ’» Code

import {
  EmailShareButton
} from 'next-share-kit'

<EmailShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  subject={'Next Share'}
  body="body"
/>
πŸ“– Props
PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.βœ…
urlstringThe URL of the shared page.βœ…
subjectstring❌
bodystring❌
separatorstring❌
blankTargetbooleanfalseOpen share window in a new tab if set to true.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

Gab

πŸ‘¨β€πŸ’» Code

import {
  GabShareButton,
} from 'next-share-kit'

<GabShareButton
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'Next Share'}
/>
πŸ“– Props
PropsTypeDefaultDescriptionRequired
childrennodeReact component, HTML element or string.βœ…
urlstringThe URL of the shared page.βœ…
titlestringTitle of the shared page.❌
windowWidthnumber660Opened window width.❌
windowHeightnumber640Opened window height.❌
bgColorstringrelated colorIt used for button background color.❌
roundbooleanfalseOpen share window in a new tab if set to true.❌
sizenumber64pxThe button size.❌
buttonTitlestringThe title of button used instead of icon.❌

πŸ’‘ Usage of ShareCount

Facebook

πŸ‘¨β€πŸ’» Code

import { FacebookShareCount } from 'next-share-kit'

<FacebookShareCount
  url='https://github.com/ayda-tech/react-share-kit'
  appId=''
  appSecret=''
/>

<FacebookShareCount
  url='https://github.com/ayda-tech/react-share-kit'
  appId=''
  appSecret=''
>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</FacebookShareCount>
πŸ“– Props
PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.βœ…
appIdstringFacebook application id.βœ…
appSecretstringFacebook application secret.βœ…
childrennodeReact component, HTML element or string.❌

Hatena

πŸ‘¨β€πŸ’» Code

import { HatenaShareCount } from 'next-share-kit'

<HatenaShareCount url={'https://github.com/ayda-tech/react-share-kit'} />

<HatenaShareCount url={'https://github.com/ayda-tech/react-share-kit'}>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</HatenaShareCount>
πŸ“– Props
PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.βœ…
childrennodeReact component, HTML element or string.❌

OK

πŸ‘¨β€πŸ’» Code

import { OKShareCount } from 'next-share-kit'

<OKShareCount url={'https://github.com/ayda-tech/react-share-kit'} />

<OKShareCount url={'https://github.com/ayda-tech/react-share-kit'}>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</OKShareCount>
πŸ“– Props
PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.βœ…
childrennodeReact component, HTML element or string.❌

Pinterest

πŸ‘¨β€πŸ’» Code

import { PinterestShareCount } from 'next-share-kit'

<PinterestShareCount url={'https://github.com/ayda-tech/react-share-kit'} />

<PinterestShareCount url={'https://github.com/ayda-tech/react-share-kit'}>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</PinterestShareCount>
πŸ“– Props
PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.βœ…
childrennodeReact component, HTML element or string.❌

Tumblr

πŸ‘¨β€πŸ’» Code

import { TumblrShareCount } from 'next-share-kit'

<TumblrShareCount url={'https://github.com/ayda-tech/react-share-kit'} />

<TumblrShareCount url={'https://github.com/ayda-tech/react-share-kit'}>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</TumblrShareCount>
πŸ“– Props
PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.βœ…
childrennodeReact component, HTML element or string.❌

VK

πŸ‘¨β€πŸ’» Code

import { VKShareCount } from 'next-share-kit'

<VKShareCount url={'https://github.com/ayda-tech/react-share-kit'} />

<VKShareCount url={'https://github.com/ayda-tech/react-share-kit'}>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</VKShareCount>
πŸ“– Props
PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.βœ…
childrennodeReact component, HTML element or string.❌

To use React-Share-Kit in your React application, import the necessary components and pass the relevant props to customize the share buttons. For example:

import React from 'react';
import { FacebookShareButton, TwitterShareButton } from 'react-share-kit';

const ShareButtons = () => {
  const shareUrl = 'https://example.com';
  const title = 'Check out this awesome website!';

  return (
      <FacebookShareButton url={shareUrl} quote={title} />
  );
};

Documentation

For more information on how to use React-Share-Kit, including a full list of available share buttons and their props, please refer to the official documentation.

License

React-Share-Kit is licensed under the MIT License. See the LICENSE file for more details.

FAQs

Package last updated on 22 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts