React component for rendering a gravatar profile image. Adjusts automatically for retina displays.
npm install --save react-gravatar
import Gravatar from 'react-gravatar'
<Gravatar email="a-email@example.com" />
<Gravatar email="mathews.kyle@gmail.com" />
<Gravatar email="mathews.kyle@gmail.com" size={150} />
For emails without a gravatar, use the retro default. You can override this by passing in a different 'default' prop. See https://en.gravatar.com/site/implement/images/ for options.
<Gravatar email="blah@blah.com" />
<Gravatar email="blahblah@blah.com" size={150} rating="pg" default="monsterid" className="CustomAvatar-image" />
email: React.PropTypes.string
— email address to generate Gravatar image for.md5: React.PropTypes.string
— Optionally just pass in a precomputed md5 hash instead of an email.size: React.PropTypes.number
— Size in pixels of image to generate. Images are always square. Defaults to 50rating: React.PropTypes.string
— rating to use. Defaults to 'g'default: React.PropTypes.string
— Pick the type of fallback image to use. Defaults to 'retro'className: React.PropTypes.string
— Add a className to the generated image.style: React.PropTypes.object
— Set styles on the image.protocol: React.PropTypes.string
— Use different protocol (http://, https://, etc.) Defaults to '//'