React Gravatar

Code on Github

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 few examples

<Gravatar email="" />Gravatar for<Gravatar email="" size={150} />Gravatar for

For emails without a gravatar, use the retro default. You can override this by passing in a different 'default' prop. See for options.

<Gravatar email="" />Gravatar for

Override all defaults

<Gravatar email="" size={150} rating="pg" default="monsterid" className="CustomAvatar-image" />Gravatar for


  • 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 50
  • rating: 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 '//'