File size: 1,070 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# Follow Button
This component is used to display a follow/unfollow button.
It has two parts, the actual button and a container that works with Redux state.
For most uses, the container is the easiest route.
## How to use the container
```js
import FollowButtonContainer from 'calypso/blocks/follow-button';
function render() {
return (
<div className="your-stuff">
<FollowButtonContainer siteUrl="http://trailnose.com" />
</div>
);
}
```
## Props
- `siteUrl`: string, a site URL to follow or unfollow
## How to use the button directly
```js
import FollowButton from 'calypso/blocks/follow-button/button';
function render() {
return (
<div className="your-stuff">
<FollowButton following={ false } />
</div>
);
}
```
## Props
- `following`: (default: false) a boolean indicating if the current user is currently following the site URL
- `disabled`: (default: false) a boolean indicating if the button is currently disabled
- `hasButtonStyle`: (default: false) a boolean indicating if the button should use a style with a button shape/border
|