Skip to content

studiofrenetic/react-avatr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<Avatr>


Initially start as a fork of https://github.com/sitebase/react-avatar to give the user the choice of priority of queue possibilities

Universal avatar makes it possible to fetch/generate an avatar based on the information you have about that user. We use a fallback system that if for example an invalid Facebook ID is used it will try Google, and so on.

For the moment we support following types:

  • Facebook
  • Google
  • Skype
  • Gravatar
  • Name initials
  • Custom text
  • Custom image

The fallbacks are in the same order as the list you defined in props.priority.

priority: ['src', 'gravatar', 'facebook', 'google', 'skype', 'name', 'value'] // Default priority list

Install

Install the component using NPM:

$ npm install react-avatr --save

Usage

  1. Import Custom Element:

    import Avatr from 'react-avatr';
  2. Start using it!

    <Avatr />

Some examples:

<Avatr  size={100}
        round={true}
        email="[email protected]"
        facebookId="131126510267471"
        googleId="109698448540584893289"
        src="http://placekitten.com/g/101/100"
        name="Studio Frenetic"
        value="SF"
        priority={['facebook', 'google', 'gravatar', 'skype', 'src', 'name', 'value']}
        />

License

MIT License

About

An avatar component built with and for ReactJS

Resources

Stars

Watchers

Forks

Packages

No packages published