![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
react-share
Advanced tools
Changelog
1.17.0 (Nov 12, 2017)
<TumblrShareButton />
and <TumblrShareCount />
(thanks @ArtBIT!)additionalProps
to share buttons to make it possible to pass any additional props (like aria-
attributes)role
(default='button') and tabIndex
(default='0') propsReadme
Easy social media share buttons and share counts.
To run demos: clone repo and run npm install && npm run run-demos
and open http://localhost:8080/demo0/
.
npm install react-share --save
ShareButtons work on all browsers.
ShareCounts works on all browsers, with the exception of Goolge Plus share count working only on IE11 and newer (XHR CORS problem).
Compatible with React versions 0.13.x
, 0.14.x
and 15.x.x
.
import {
ShareButtons,
ShareCounts,
generateShareIcon
} from 'react-share';
const {
FacebookShareButton,
GooglePlusShareButton,
LinkedinShareButton,
TwitterShareButton,
TelegramShareButton,
WhatsappShareButton,
PinterestShareButton,
VKShareButton,
OKShareButton,
RedditShareButton,
TumblrShareButton,
EmailShareButton,
} = ShareButtons;
Required props | Optional props | |
---|---|---|
All | children : A React node (e.g. string or element)url : URL of the shared page (string) | disabled : Disables click action and adds disabled class (bool)disabledStyle : Style when button is disabled (object, default = { opacity: 0.6 })windowWidth , windowHeight : opened window dimensions (int, different defaults for all share buttons)beforeOnClick : Takes a function that returns a Promise to be fulfilled before calling onClick . If you do not return promise, onClick is called immediately.onShareWindowClose : Takes a function to be called after closing share dialog.additionalProps : An object to pass any additional properties, such as aria-* attributes. |
FacebookShareButton | - | quote : A quote to be shared along with the link. (string)hashtag : A hashtag specified by the developer to be added to the shared content. People will still have the opportunity to remove this hashtag in the dialog. The hashtag should include the hash symbol. (string) |
GooglePlusShareButton | - | - |
LinkedinShareButton | - | title : Title of the shared page (string)description : Description of the shared page (string) |
TwitterShareButton | - | title : Title of the shared page (string)via : (string)hashtags : (array) |
TelegramShareButton | - | title : Title of the shared page (string) |
WhatsappShareButton | - | title : Title of the shared page (string)separator : Separates title from the url, default: " " (string) |
PinterestShareButton | media : An absolute link to the image that will be pinned (string) | description : Description for the shared media. |
VKShareButton | - | title : Title of the shared page (string)description : Description of the shared page (string)image : An absolute link to the image that will be shared (string) |
OKShareButton | - | title : Title of the shared page (string)description : Description of the shared page (string)image : An absolute link to the image that will be shared (string) |
RedditShareButton | - | title : Title of the shared page (string) |
TumblrShareButton | - | title : Title of the shared page (string)tags : (array)caption : Description of the shared page (string) |
EmailShareButton | - | subject : Title of the shared page (string)body : Body of the email (string), defaults to shared url. |
const {
FacebookShareCount,
GooglePlusShareCount,
LinkedinShareCount,
PinterestShareCount,
VKShareCount,
OKShareCount,
RedditShareCount,
TumblrShareCount,
} = ShareCounts;
All share count components take in only one mandatory prop: url
, which is the
URL you are sharing. className
prop is optional.
Example:
<FacebookShareCount url={shareUrl} />
If you want to render anything else but the count,
you can provide a function as a child element that takes in shareCount
as an
argument and returns an element:
<FacebookShareCount url={shareUrl}>
{shareCount => (
<span className="myShareCountWrapper">{shareCount}</span>
)}
</FacebookShareCount>
const FacebookIcon = generateShareIcon('facebook');
const TwitterIcon = generateShareIcon('twitter');
const TelegramIcon = generateShareIcon('telegram');
const WhatsappIcon = generateShareIcon('whatsapp');
const GooglePlusIcon = generateShareIcon('google');
const LinkedinIcon = generateShareIcon('linkedin');
const PinterestIcon = generateShareIcon('pinterest');
const VKIcon = generateShareIcon('vk');
const OKIcon = generateShareIcon('ok');
const RedditIcon = generateShareIcon('reddit');
const TumblrIcon = generateShareIcon('tumblr');
const EmailIcon = generateShareIcon('email');
Props:
size
: Icon size in pixels (number)
round
: Whether to show round or rect icons (bool)
iconBgStyle
: customize background style, e.g. fill
(object)
logoFillColor
: customize logo's fill color (string, default = 'white')
Example:
<TwitterIcon size={32} round={true} />
This library uses the standard semver convention. However, the share buttons and and counts are prone to lots of changes that are not in control of this library. For example: if Facebook decides to change or deprecate it's API in a major way, this library will not get a major version bump just because of that. Keep this in mind when you are planning the maintenance of your application.
MIT
Icon paths provided by: react-social-icons.
FAQs
Social media share buttons and share counts for React.
The npm package react-share receives a total of 392,796 weekly downloads. As such, react-share popularity was classified as popular.
We found that react-share demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.