Giter Site home page Giter Site logo

uxengineerlab / react-native-user-avatar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from avishayil/react-native-user-avatar

1.0 2.0 0.0 132 KB

Avatar Component For React Native

License: MIT License

JavaScript 36.75% Python 13.92% Java 11.80% Objective-C 37.53%

react-native-user-avatar's Introduction

React Native User Avatar

npm version npm downloads

A bare-bones user avatar display with support for falling back to using the user's initials on a colored background as the avatar. Based on the great library for React: https://github.com/wbinnssmith/react-user-avatar, and ported to React Native.

Installation

npm install --save react-native-user-avatar or yarn add react-native-user-avatar

Usage

  <UserAvatar size="100" name="Avishay Bar" />
  <UserAvatar size="100" name="Avishay Bar" src="https://dummyimage.com/100x100/000/fff" />
  <UserAvatar size="50" name="John Doe" colors={['#ccc', '#fafafa', '#ccaabb']}/>
  <UserAvatar size="50" name="John Doe" />
  <UserAvatar size="50" name="Jane Doe" color="#000" />

User-defined Image-Component

It is also possible to use another Image-Component than the built-in <Image>.

  <UserAvatar size="50" name="John Doe" component={CachedImage} />

The fallback avatar's color may be set by passing in the color prop, or you can customize the range of colors used by passing in an array of colors. The component uses a simple calculation to consistently use the same color for the same user's name every time.

Credits

@wbinnssmith

##License

MIT

react-native-user-avatar's People

Contributors

avishayil avatar itinance avatar luizeduard0 avatar martin25699 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.