πŸš€ 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.12
Source
npm
Version published
Weekly downloads
1.2K
-4.07%
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.

downloads downloads

NPM npm bundle size Build Status JavaScript Style Guide

Table of Contents

Installation

To install React-Share-Kit, simply run:

npm install react-share-kit

or

yarn add react-share-kit

πŸ”₯ Share Buttons Detault Props

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:

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

import React from 'react';
import { FacebookShare, TwitterShare } from 'react-share-kit';

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

  return (
      <FacebookShare url={shareUrl} quote={title} />
      <TwitterShare url={shareUrl} round title="X" />
  );
};

πŸ“• Default Props

PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.TRUE
titlestringThe title of the shared page.FALSE
windowWidthnumber550Opened window width.FALSE
windowHeightnumber400Opened window height.FALSE
blankTargetbooleanfalseOpen share window in a new tab if set to true.FALSE
bgColorstringrelated colorIcon background color.FALSE
roundbooleanfalseThe "round" attribute creates a fully circular button shape, giving it a 100% rounded appearance.FALSE
borderRadiusnumber0pxCustom round share.FALSE
sizenumber64pxThe button size.FALSE
buttonTitlestringThe title of button used instead of icon.FALSE

πŸ’‘ Usage of ShareButtons

Linkedin

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

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

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

Twitter

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

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

<TwitterShare
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'react-share-kit - social share buttons for next & react apps.'}
  hashtags=["#react-share-kit", "#front-end"]
/>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
viastringFALSE
hashtagsarrayFALSE
relatedarrayFALSE

Facebook

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

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

<FacebookShare
  url={'https://github.com/ayda-tech/react-share-kit'}
  quote={'react-share-kit - social share buttons for next & react apps.'}
  hashtag={'#react-share-kit'}
/>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
quotestringA quote to be shared.FALSE
hashtagstringHashtag to be shared.FALSE

FacebookMessenger

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

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

<FacebookMessengerShareButton
  url='https://github.com/ayda-tech/react-share-kit'
  redirectUri="https://github.com/ayda-tech/react-share-kit"
  appId={'dmm4kj9djk203k4liuf994p'}
/>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
appIdstringFacebook application id.TRUE
redirectUristringThe URL to redirect to after sharing (default: the shared url).FALSE
tostringA user ID of a recipient. Once the dialog comes up, the sender can specify additional people as recipients.FALSE

Whatsapp

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

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

<WhatsappShare
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'react-share-kit - social share buttons for next & react apps.'}
  separator=":: "
/>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
separatorstringFALSE

Telegram

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

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

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

Line

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

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

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

Pinterest

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

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

<PinterestShare
  url={'https://github.com/ayda-tech/react-share-kit'}
  media={'react-share-kit - social share buttons for next & react apps.'}
/>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
mediastringThe image URL that will be pinned.TRUE
descriptionstringThe description of the shared media.FALSE

Reddit

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

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

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

Tumblr

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

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

<TumblrShare
  url={'https://github.com/ayda-tech/react-share-kit'}
  caption="react-share-kit - social share buttons for next & react apps."
/>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
tagsArray<string>FALSE
captionstringThe description of the shared page.FALSE
posttypestringlinkFALSE

Viber

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

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

<ViberShare
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'react-share-kit - social share buttons for next & react apps.'}
/>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
separatorstringFALSE

Weibo

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

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

<WeiboShare
  url={'https://github.com/ayda-tech/react-share-kit'}
  title={'react-share-kit - social share buttons for next & react apps.'}
  image={`${String(window.location)}/${example-image}`}
/>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
imagestringThe image URL that will be shared.FALSE

VK

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

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

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

πŸ“• Props

PropsTypeDefaultDescriptionRequired
imagestringAn absolute link to the image that will be shared.FALSE
noParsebooleanIf true is passed, VK will not retrieve URL information.FALSE
noVkLinksbooleanIf true is passed, there will be no links to the user's profile in the open window. Only for mobile devices.FALSE

Mailru

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

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

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

πŸ“• Props

PropsTypeDefaultDescriptionRequired
descriptionstringDescription of the shared page.FALSE
imageUrlstringImage url of the shared page.FALSE

LiveJournal

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

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

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

πŸ“• Props

PropsTypeDefaultDescriptionRequired
descriptionstringDescription of the shared page.FALSE

Workplace

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

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

<WorkplaceShare
  url={'https://github.com/ayda-tech/react-share-kit'}
  quote={'React Share Kit'}
/>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
quotestringFALSE
hashtagstringFALSE

Pocket

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

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

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

Instapaper

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

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

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

πŸ“• Props

PropsTypeDefaultDescriptionRequired
descriptionstringDescription of the shared page.FALSE

Hatena

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

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

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

Gab

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

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

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

πŸ’‘ Usage of ShareCount

Facebook

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

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

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

<FacebookCount
  url='https://github.com/ayda-tech/react-share-kit'
  appId=''
  appSecret=''
>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</FacebookCount>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.TRUE
appIdstringFacebook application id.TRUE
appSecretstringFacebook application secret.TRUE
childrennodeReact component, HTML element or string.FALSE

Hatena

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

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

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

<HatenaCount url={'https://github.com/ayda-tech/react-share-kit'}>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</HatenaCount>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.TRUE
childrennodeReact component, HTML element or string.FALSE

OK

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

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

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

<OKCount url={'https://github.com/ayda-tech/react-share-kit'}>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</OKCount>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.TRUE
childrennodeReact component, HTML element or string.FALSE

Pinterest

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

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

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

<PinterestCount url={'https://github.com/ayda-tech/react-share-kit'}>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</PinterestCount>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.TRUE
childrennodeReact component, HTML element or string.FALSE

Tumblr

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

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

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

<TumblrCount url={'https://github.com/ayda-tech/react-share-kit'}>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</TumblrCount>

πŸ“• Props</b

PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.TRUE
childrennodeReact component, HTML element or string.FALSE

VK

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

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

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

<VKCount url={'https://github.com/ayda-tech/react-share-kit'}>
  {shareCount => <span className="wrapper">{shareCount}</span>}
</VKCount>

πŸ“• Props

PropsTypeDefaultDescriptionRequired
urlstringThe URL of the shared page.TRUE
childrennodeReact component, HTML element or string.FALSE

License

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

Keywords

react-share-kit

FAQs

Package last updated on 26 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