Simple, clean, customizable sharing buttons.
The default share buttons used by the social networks are not only ugly to look at (sorry, they just are) but they usually depend on iframes and all sorts of other horrible, slow code. That led to creating shr (short for share).
- Accessible - built right, using progressive enhancement.
- Lightweight - just 1.9KB minified and gzipped.
- Customisable - make the buttons and count look how you want with the markup you want.
- Semantic - uses the right elements. There's no
<span>
as button type hacks. - Fast - uses local storage to cache results to keep things fast.
- No dependencies - written in vanilla JavaScript, no jQuery required.
Oh and yes, it works with Bootstrap.
Check out the changelog
- More networks
If you have any cool ideas or features, please let me know by creating an issue or of course, forking and sending a pull request.
Check docs/index.html
and docs/dist/docs.js
for an example setup.
If you want to use our CDN, you can use the following:
<link rel="stylesheet" href="https://cdn.shr.one/0.1.9/shr.css">
<script src="https://cdn.shr.one/0.1.9/shr.js"></script>
If you want to use the default css, add the shr.css
file from /dist into your head, or even better use shr.less
or shr.scss
file included in /src
in your build to save a request.
<link rel="stylesheet" href="dist/shr.css">
TBC
Much of the behaviour of the player is configurable when initialising the library. Here's an example of a default setup:
<script src="dist/shr.js"></script>
<script>shr.setup();</script>
TBC
Safari | Firefox | Chrome | Opera | IE9 | IE10+ |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
If you find anything weird with Shr, please let us know using the GitHub issues tracker.
Shr is developed by @sam_potts / sampotts.me from @selz / selz.com