Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-social-share1

code530pro0MIT1.0.0TypeScript support: included

Social media share for React, Nextjs and React applications.

react-social-share, react-share, next-share, social-share, share-button, social-count, social-share-buttons, social-media-share-buttons, share, social, button, react, nextjs, next.js support

readme

React-Socal-Share

react-social-share is a simple and easy-to-use library for adding social media share buttons to your React, Next and react applications.

downloads downloads

NPM npm bundle size JavaScript Style Guide

Share buttons screenshot


Installation

To install react-social-share, simply run:

npm install react-social-share

or

yarn add react-social-share

📲 Supported Platforms

  • Facebook
  • Twitter
  • LinkedIn
  • WhatsApp
  • Telegram
  • Messenger
  • Email
  • Pinterest
  • Reddit
  • Line

📕 Share Button Global Props

Each button supports a set of global props that are consistent across all buttons. However, in addition to these global props, each button also possesses its own unique set of specific properties. These specific properties are tailored to the individual functionality and customization options of each button.

Props Type Default Description Required
url string | The URL of the shared page. TRUE
title string | The title of the shared page. FALSE
windowWidth number 550 Opened window width. FALSE
windowHeight number 400 Opened window height. FALSE
blankTarget boolean false Open share window in a new tab if set to true. FALSE
bgColor string related color Icon background color. FALSE
round boolean false The "round" attribute creates a fully circular button shape, giving it a 100% rounded appearance. FALSE
borderRadius number 0px Custom round share. FALSE
size number 64px The button size. FALSE
buttonTitle string | The title of button used instead of icon. FALSE

👨‍💻 Example

import React from 'react'
import { FacebookShare } from 'react-social-share'

const ShareButtons = () => {
  const shareUrl = 'https://github.com/code530pro/react-social-share'
  const title = 'Check out this awesome website!'

  return <FacebookShare url={shareUrl} quote={title} />
}

License

react-social-share is licensed under the MIT License.