2.0.1 • Published 6 years ago

react-native-badge-view v2.0.1

Weekly downloads
15
License
ISC
Repository
github
Last release
6 years ago

RNBadgeView

npm

Installation

npm i react-native-badge-view -S

Base Use

<BadgeView parentView={<View style={{width: 40, height: 40, backgroundColor: 'blue'}}/>} 
           badgeText={"12"}/>
<BadgeView parentView={<View style={{width: 40, height: 40, backgroundColor: 'blue'}}/>
                } badgeImageSource={require('./badge-view/test.png')}/>

Prop

PropTypeRequiredDefaultComment
badgePositionstringoptionalrightThe position of badge, one of right or left
badgeTextstringoptional--The text of badge, if the text is an empty string or equal to 0, the badge will be invisible.
badgeImageSource{uri:string},numberoptional--The image source of badge.It works only the badgeText is empty.
badgeImageWidthnumberoptional20The width of badge image. It works only the badgeImageSource is not empty.
badgeImageHeightnumberoptional20The height of badge image. It works only the badgeImageSource is not empty.
badgeTextColorstringoptionalwhiteThe text color of badge, default is white.
autoSizebooloptionaltrueWhen the prop is true, the badge size will be self-adaption to the text size.
badgeSizenumberoptional20The size of badge,default is 20. It works only when the autoSize is false.
badgeBackgroundColorstringoptionalredThe background color of badge, default is red.
parentViewelementrequired--The parent view of badge, it is required.

ScreenShot

ScreenShot