πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Sign inDemoInstall
Socket

react-native-avatar-social

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-avatar-social

React Native library to generate avatar social.

0.0.3
latest
Source
npm
Version published
Weekly downloads
22
100%
Maintainers
1
Weekly downloads
Β 
Created
Source

React Native: react-native-avatar-social

GitHub package version github home platforms github home npm

github issues github closed issues Issue Stats github license

PNG

  • Usage
  • License

πŸ“– Getting started

$ npm install react-native-avatar-social --save

$ react-native link react-native-material-letter-icon

$ react-native link react-native-vector-icons

πŸ’» Usage

import React, { Component } from 'react';
import { View } from 'react-native';
import AvatarSocial from 'react-native-avatar-social';

export default class App extends Component {
  render() {
    return (
      <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
        <AvatarSocial
          dim={150}
          image={{
              uri: 'https://image.tmdb.org/t/p/w300_and_h450_bestv2/lvQypTfeH2Gn2PTbzq6XkT2PLmn.jpg'
          }}
          name="Connie Nielsen"
          type="image"
          isStatus={true}
          isIcon={false}
          iconSize={25}
          iconColor={'#26C6DA'}
          badgeText={100}
          badgeColor={'#ffffff'}
          badgeBackground={'#303030'}
          badgeFunction={e => {
            return e > 99 ? '99+' : e;
          }}
        />
        <AvatarSocial
          dim={150}
          image={{
              uri: 'https://image.tmdb.org/t/p/w300_and_h450_bestv2/lvQypTfeH2Gn2PTbzq6XkT2PLmn.jpg'
          }}
          name="Connie Nielsen"
          type="image"
          isStatus={true}
          isIcon={false}
          iconSize={25}
          iconColor={'#26C6DA'}
          badgeText={100}
          badgeColor={'#ffffff'}
          badgeBackground={'#ff9d00'}
          positionStatus="right"
        />
        <AvatarSocial
          dim={80}
          image={{
              uri: 'https://image.tmdb.org/t/p/w300_and_h450_bestv2/lvQypTfeH2Gn2PTbzq6XkT2PLmn.jpg'
          }}
          name="Connie Nielsen"
          type="image"
          isStatus={true}
          isIcon={false}
          badgeText={'100'}
          badgeColor={'#ffffff'}
          badgeBackground={'#303030'}
          badgeFunction={e => {
            return e > 99 ? '99+' : e;
          }}
          positionStatus="left"
        />
        <AvatarSocial
          dim={80}
          image={{
              uri: 'https://image.tmdb.org/t/p/w300_and_h450_bestv2/lvQypTfeH2Gn2PTbzq6XkT2PLmn.jpg'
          }}
          name="Connie Nielsen"
          type="image"
          isStatus={true}
          isIcon={true}
          icon={'star'}
          iconColor="#ff9d00"
        />
        <AvatarSocial
          dim={80}
          image={{
              uri: 'https://image.tmdb.org/t/p/w300_and_h450_bestv2/lvQypTfeH2Gn2PTbzq6XkT2PLmn.jpg'
          }}
          name="Connie Nielsen"
          isStatus={true}
          isIcon={false}
          badgeText={100}
          badgeColor={'#ffffff'}
          badgeBackground={'#303030'}
          badgeFunction={e => {
            return e > 99 ? '99+' : e;
          }}
          positionStatus="left"
        />
        <AvatarSocial
          dim={80}
          image={{
              uri: 'https://image.tmdb.org/t/p/w300_and_h450_bestv2/lvQypTfeH2Gn2PTbzq6XkT2PLmn.jpg'
          }}
          name="Connie Nielsen"
          isStatus={true}
          isIcon={true}
          icon={'star'}
          iconColor="#ff9d00"
        />
      </View>
    );
  }
}

πŸ’‘ Props

PropTypeDefaultNote
dimnumberAvatar size.
imageobjWe need to pass an url image, as in the example, or a required local image.
namestringName to pass in case you want to use the letter mode or the image attribute is not found.
typestringletterChoose whether to use the letter or image mode, to use image you have to pass an image url.
isStatusboolIndicates whether to have the status icon.
isIconboolIndicates whether to have the status icon.
iconFontAwesomeIndicates what kind of icon to use.
iconSizenumberIcon size.
iconColorstringIcon color.
badgeTextstringBadge text.
badgeColorstring#000000Color of the badge text.
badgeBackgroundstringtransparentBackground color of the badge.
badgeFunctionfunctionUse in case you want to define a function, for the badgeText attribute.
positionStatusstringleftStatus position

πŸ“œ License

This library is provided under the Apache License.

Keywords

react-native

FAQs

Package last updated on 10 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts