Introducing the unofficial

GitHub buttons

Showcase your GitHub repo's success with hotlinkable GitHub star, fork, or follow buttons. Available in two sizes with up-to-date counts.

Made by @mdo. Available on GitHub. Licensed Apache 2.


Contents


Star

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=star&count=true&size=large" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=star&count=true" frameborder="0" scrolling="0" width="170px" height="20px"></iframe>

Watch

Originally, GitHub’s Watch button was used for notification settings (today’s Watch) and repository bookmarking (today’s Star). In August 2012, they split the functionality into two buttons, after these unofficial buttons were released.

As such, for today’s unofficial Watch button, you must add v=2 to the parameters. If you don’t, you’ll get the deprecated button.

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=watch&count=true&size=large&v=2" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=watch&count=true&v=2" frameborder="0" scrolling="0" width="170px" height="20px"></iframe>

Fork

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=fork&count=true&size=large" frameborder="0" scrolling="0" width="158px" height="30px"></iframe>

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=fork&count=true" frameborder="0" scrolling="0" width="170px" height="20px"></iframe>

Follow

<iframe src="https://ghbtns.com/github-btn.html?user=mdo&type=follow&count=true&size=large" frameborder="0" scrolling="0" width="220px" height="30px"></iframe>

<iframe src="https://ghbtns.com/github-btn.html?user=mdo&type=follow&count=true" frameborder="0" scrolling="0" width="170px" height="20px"></iframe>

Available options

SSL support

Example buttons are shown with https:// URLs. While they’re hosted on GitHub Pages, the SSL option is provided via CloudFlare’s free Universal SSL offering. If you prefer, you can still use http://.

Required parameters

You must declare a value for each of the following URL parameters:

Option Description
user GitHub username that owns the repo
repo GitHub repository to pull the forks and watchers counts
type Type of button to show: watch, fork, or follow

Optional parameters

The following URL parameters are not required. Add them as you wish.

Option Description
count Show the optional watchers or forks count: none by default or true
size Optional flag for using a larger button: none by default or large

Deprecated

Original Watch, aka Star

With the button split in August 2012, GitHub’s API continued to return the Star count for old Watch buttons. Thus, the original unofficial Watch button returns a makeshift Star button.

This deprecated button is still around to avoid breaking every site that currently utilizes these embeds.

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=watch&count=true&size=large" frameborder="0" scrolling="0" width="170px" height="30px"></iframe>

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=watch&count=true" frameborder="0" scrolling="0" width="170px" height="20px"></iframe>

Limitations

For these first versions, functionality is limited and some concessions made:

More refinement and functionality is planned with open-sourcing–any help is always appreciated!


Open source

The unofficial GitHub buttons are available on GitHub for downloading, forking, or contributing.

View on GitHub


<3