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.
Installation
To install react-social-share, simply run:
npm install react-social-share
or
yarn add react-social-share
📲 Supported Platforms
- Telegram
- Messenger
- 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.