Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-icon-badge

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-icon-badge

add icon badge to other element for React Native

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-5.97%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-icon-badge

npm

Icon badge is used to create icon badge on some element, such as avatar, icon, image.... The badge is used to give some alert to user of specific element.

For example: demo

How to use

Install package:

npm install --save react-native-icon-badge

Import to your app:

...
import IconBadge from 'react-native-icon-badge';
...

Use the component:

<View style={{flexDirection: 'row',alignItems: 'center',justifyContent: 'center',}}>
  <IconBadge
    MainElement={
      <View style={{backgroundColor:'#489EFE',
        width:50,
        height:50,
        margin:6
      }}/>
    }
    BadgeElement={
      <Text style={{color:'#FFFFFF'}}>{this.state.BadgeCount}</Text>
    }
    IconBadgeStyle={
      {width:30,
      height:30,
      backgroundColor: '#FF00EE'}
    }
    Hidden={this.state.BadgeCount==0}
    />
</View>

API

API table

API nameUsage
MainElementThe background element.
BadgeElementThe badge element, nomally it is a Text.
IconBadgeStyleCustomrized badge style.(Optional)
HiddenHides badge.(Optional)

Defaute badge style

IconBadge: {
  position:'absolute',
  top:1,
  right:1,
  width:20,
  height:20,
  borderRadius:15,
  alignItems: 'center',
  justifyContent: 'center',
  backgroundColor: '#FF0000'
}

Keywords

FAQs

Package last updated on 10 Jul 2017

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc