Socket
Book a DemoInstallSign in
Socket

@nghinv/react-native-badge

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nghinv/react-native-badge

React Native badge Library

0.0.2
latest
Source
npmnpm
Version published
Weekly downloads
7
-58.82%
Maintainers
1
Weekly downloads
 
Created
Source

@nghinv/react-native-badge

React Native Badge Library

CircleCI Version MIT License All Contributors PRs Welcome

Installation

yarn add @nghinv/react-native-badge

or

npm install @nghinv/react-native-badge

Usage

import React from 'react';
import { View, StyleSheet } from 'react-native';
import Badge from '@nghinv/react-native-badge';

function App() {
  return (
    <View style={styles.container}>
      <Badge 
        backgroundColor='green' 
        containerStyle={styles.badge} 
        label="3" 
        size={20} 
        labelFormatterLimit={2} 
      />
      <Badge 
        backgroundColor='orange' 
        containerStyle={styles.badge} size='pimpleSmall' 
        labelFormatterLimit={2} 
      />
      <Badge 
        containerStyle={styles.badge} 
        label="1234" 
        size='large' 
        labelFormatterLimit={2} 
      />
      <Badge 
        containerStyle={styles.badge} 
        label="9999" 
        size={20} 
        labelFormatterLimit={3} 
      />
      <Badge 
        containerStyle={styles.badge} 
        label="84" 
        size={20} 
        labelFormatterLimit={2} 
      />
      <Badge 
        backgroundColor='tomato' 
        containerStyle={styles.badge} 
        label="1234" 
        size={20} 
        labelFormatterLimit={4} 
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
  badge: {
    margin: 16,
  },
});

export default App;

Property

PropertyTypeDefaultDescription
labelstringundefined
sizeBadgeSizes | number20
labelColorstringwhite
backgroundColorstring#f44336
containerStyleStyleProp<ViewStyle>
labelStyleTextStyleundefined
labelFormatterLimit0 | 1 | 2 | 3 | 4undefined
labelPropsTextPropsundefined

BadgeSizes = pimpleSmall | pimpleBig | pimpleHuge | small | default | large

Credits

  • @Nghi-NV

Keywords

react-native

FAQs

Package last updated on 31 Jul 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.