# react-native-icon-badge

> add icon badge to other element for React Native

Latest version **1.1.3** (published 2017-07-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-native-icon-badge
pnpm add react-native-icon-badge
yarn add react-native-icon-badge
bun add react-native-icon-badge
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2017-07-10 |
| First published | 2016-05-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 165 |
| Author | Frank Wang, Tomyli, Cynric |
| Maintainers | yanqiw |
| Keywords | react-native, icon-badge, react-native-component |

## Links

- npm: https://www.npmjs.com/package/react-native-icon-badge
- Repository: https://github.com/yanqiw/react-native-icon-badge
- Homepage: https://github.com/yanqiw/react-native-icon-badge#readme
- Issues: https://github.com/yanqiw/react-native-icon-badge/issues
- npm.io page: https://npm.io/package/react-native-icon-badge

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2017-07-10
- 1.1.2 — 2017-06-28
- 1.1.1 — 2016-08-02
- 1.1.0 — 2016-06-02
- 1.0.4 — 2016-05-07
- 1.0.3 — 2016-05-06
- 1.0.2 — 2016-05-05
- 1.0.1 — 2016-05-05
- 1.0.0 — 2016-05-05
- 0.1.0 — 2016-05-05

## README

# react-native-icon-badge

[![npm](https://img.shields.io/npm/v/react-native-icon-badge.svg?style=flat-square)](https://www.npmjs.com/package/react-native-icon-badge)

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](demo.png)


## How to use
Install package:
```bash
npm install --save react-native-icon-badge
```

Import to your app:
```javascript
...
import IconBadge from 'react-native-icon-badge';
...
```

Use the component:
```javascript
<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 name       | Usage
---------------|----------------------------------------
MainElement    | The background element.
BadgeElement   | The badge element, nomally it is a Text.
IconBadgeStyle | Customrized badge style.(Optional)
Hidden         | Hides badge.(Optional)


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

---
_Source: https://npm.io/package/react-native-icon-badge · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
