Socket
Socket
Sign inDemoInstall

react-native-avatar-social

Package Overview
Dependencies
81
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-avatar-social

React Native library to generate avatar social.


Version published
Maintainers
1
Install size
5.34 MB
Created

Readme

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

📖 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

FAQs

Last updated on 10 Jul 2019

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc