An element providing a wrapper for quick gravatar images.
npm install --save gravatar-component
Test it here
1.Simple gravatar image with an alt text:
<gravatar-component email="marios@mist.io" alt-text="Marios Fakiolas"></gravatar-component>
2.Simple gravatar url with a custom fallback image:
<gravatar-component email="some@email.com" default-image="http://webcomponents.org/img/icon-customelementsio.png" alt-text="Marios Fakiolas"></gravatar-component>
3.Simple secure retina ready gravatar:
<gravatar-component email="marios@mist.io" retina secure></gravatar-component>
4.Simple gravatar image with monsterid images as fallbak
<gravatar-component email="some@email.com" image-set="monsterid"></gravatar-component>
5.Simple gravatar image using hash
<gravatar-component hash="64fbed45615b9b322e2f0dbeadfe97a9" size="200"></gravatar-component>
Attribute | Type | Default Value | Description |
---|---|---|---|
altText | String | null | Image's alternate text |
defaultImage | String | null | Custom default image as fallback |
String | null | The email address | |
hash | String | null | Hashed Email |
imageSet | String | mm | Default imageset to use if not custom defaultImage is provided [ 404 , mm , identicon , monsterid , wavatar ] |
rating | String | g | Maximum rating (inclusive) [ g , pg , r , x ] |
secure | Boolean | false | True for Https and False for Http |
size | Number | 80 | Size in pixels, defaults to 80px [ 1 - 2048 ] |
retina | Boolean | false | True in order to check for retina screen and request a gravatar with double size |
MIT license.