You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP

react-share

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-share

Social media share buttons and share counts for React.

5.2.2
latest
Version published
Weekly downloads
378K
-1.33%
Maintainers
0
Weekly downloads
 
Created

What is react-share?

The react-share npm package provides a collection of social media share buttons and share counts for React applications. It supports a wide range of social media platforms and allows for easy integration of sharing functionalities.

What are react-share's main functionalities?

Facebook Share Button

This feature allows you to create a Facebook share button with a customizable icon. The button can be used to share a specified URL on Facebook.

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

const FacebookShare = () => (
  <FacebookShareButton url={'https://example.com'}>
    <FacebookIcon size={32} round={true} />
  </FacebookShareButton>
);

Twitter Share Button

This feature allows you to create a Twitter share button with a customizable icon. The button can be used to share a specified URL and title on Twitter.

import { TwitterShareButton, TwitterIcon } from 'react-share';

const TwitterShare = () => (
  <TwitterShareButton url={'https://example.com'} title={'Check this out!'}>
    <TwitterIcon size={32} round={true} />
  </TwitterShareButton>
);

LinkedIn Share Button

This feature allows you to create a LinkedIn share button with a customizable icon. The button can be used to share a specified URL on LinkedIn.

import { LinkedinShareButton, LinkedinIcon } from 'react-share';

const LinkedinShare = () => (
  <LinkedinShareButton url={'https://example.com'}>
    <LinkedinIcon size={32} round={true} />
  </LinkedinShareButton>
);

Share Count

This feature allows you to display the share count for a specified URL on Facebook. Similar components are available for other social media platforms.

import { FacebookShareCount } from 'react-share';

const FacebookShareCountExample = () => (
  <FacebookShareCount url={'https://example.com'} />
);

Other packages similar to react-share

FAQs

Package last updated on 25 Feb 2025

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