Introducing the unofficial
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.
<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>
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>
<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>
<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>
<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>
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.
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 |
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
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>
For these first versions, functionality is limited and some concessions made:
frameborder
and scrolling
attributes by default since we cannot know your setup, but you can optionally remove them and set them yourself via CSS:iframe {
overflow: hidden;
border: 0;
}
More refinement and functionality is planned with open-sourcing—any help is always appreciated!
The unofficial GitHub buttons are available on GitHub for downloading, forking, or contributing.
❤️