Simple React components for social (Facebook, Twitter and Pinterest) buttons and social counts.
npm install react-social --save
var FacebookButton = require("./react-social").FacebookButton
, FacebookCount = require("./react-social").FacebookCount;
var App = React.createClass({
render: function () {
var url = "https://github.com";
return (
<FacebookButton url={url}>
<FacebookCount url={url} />
{" Share " + url}
</FacebookButton>
);
}
});
Change the element the component renders into default is span.
The url you want to get the count of, default is window.location
.
Return the social count.
Change the element the component renders into default is button.
The url you want to share, default is window.location
.
A message that's prepended before the url, works only with FacebookButton and TwitterButton.
Url of an image, is required for PinterestButton and only works with PinterestButton.
The components pass their props down to their element including className
and
style
.
MIT Licensed