Introducing the unofficial

GitHub buttons

Showcase your GitHub repo’s success with hotlinkable GitHub star, fork, sponsor, and 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="170" height="30" title="GitHub"></iframe>

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=star&count=true" frameborder="0" scrolling="0" width="150" height="20" title="GitHub"></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="170" height="30" title="GitHub"></iframe>

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=watch&count=true&v=2" frameborder="0" scrolling="0" width="150" height="20" title="GitHub"></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="170" height="30" title="GitHub"></iframe>

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

Follow

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

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

<iframe src="https://ghbtns.com/github-btn.html?user=mdo&type=sponsor" frameborder="0" scrolling="0" width="150" height="20" title="GitHub"></iframe>

No text variant

<iframe src="https://ghbtns.com/github-btn.html?user=twbs&repo=bootstrap&type=star&size=large&text=false" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></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.

Required parameters

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

Option Description
user GitHub username that owns the repo/Username to sponsor
repo GitHub repository to pull the forks and watchers counts
type Type of button to show: watch, fork, sponsor, 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
text Optional flag for hiding the text: none by default or false

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="170" height="30" title="GitHub"></iframe>

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

Limitations

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

iframe {
  overflow: hidden;
  border: 0;
}

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


❤️