@sugarshin/react-social
v0.0.2
Published
React components for social share on ES6 class
Downloads
25
Maintainers
Readme
react-social
React components for social share on ES6 class
Fork on olahol/react-social
Getting started
npm install @sugarshin/react-social
Usage
import React from 'react';
import {
FacebookButton,
FacebookCount
} from 'react-social';
class App extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<FacebookButton url={this.props.url}>
<FacebookCount url={this.props.url} />
{`Share ${this.props.url}`}
</FacebookButton>
);
}
}
React.render(<App url={'https://github.com/sugarshin/react-social'} />, document.body);
Count (FacebookCount, TwitterCount, PinterestCount) API
Props
element
Change the element the component renders into default is span.
url
The url you want to get the count of, default is window.location
.
Methods
getCount()
Return the social count.
Button (FacebookButton, TwitterButton, PinterestButton) API
Props
element
Change the element the component renders into default is button.
url
The url you want to share, default is window.location
.
media (required for Pinterest)
Url of an image, required for PinterestButton.
Styles
The components pass their props down to their element including className
and
style
.
License
© sugarshin