Home

Awesome

React Native Gravatar component

npm version npm downloads

React Native Gravatar is a simple component that loads the avatar with an option to mask it with a circle, rounded or square shape.

Installation

npm install react-native-avatar-gravatar

Usage

import Gravatar from 'react-native-avatar-gravatar';

class Application extends Component {  
  render () {
    return (
      <Gravatar emailAddress="robin02+npm@gmail.com" size={300} mask="circle" />
    )
  }
})

Properties

Basic

PropDefaultTypeDescription
emailAddress''stringEmail address for gravatar, if not provided uses default image for gravatar
size60numberSize for the gravatar image
mask'circle'numberMask for the gravatar image. One of - 'circle', 'square', 'rounded'
defaultImage'retro'stringdefault image if no email address. One of - '404', 'mm', 'identicon', 'monsterid', 'wavatar', 'retro', 'robohash', 'blank'
resizeMode'contain'stringresizeMode for the gravatar image