Badge
Round colored badge, typically used to show a number
(code example)
info
This component extends TouchableOpacity, View props.
#
Usage<Badge label={'999'} size={16}/>
#
API#
backgroundColorBackground color
string
#
borderColorColor of border around the badge
ImageStyle['borderColor']
#
borderRadiusRadius of border around the badge
number
#
borderWidthWidth of border around the badge
number
#
containerStyleAdditional styles for the top container
ViewStyle
#
customElementCustom element to render instead of an icon
JSX.Element
#
hitSlopDefines how far a touch event can start away from the badge
ViewProps['hitSlop']
#
iconRenders an icon badge
ImageSourcePropType
#
iconPropsAdditional props passed to icon
ImageProps
#
iconStyleAdditional styling to badge icon
ImageStyle
#
label#
Passing a label (undefined) will present a pimple badgeText to show inside the badge
string
#
labelFormatterLimit#
Beyond the max number for that digit length, a '+' will show at the end.If set to a value not included in LABEL_FORMATTER_VALUES, no formatting will occur.
Example: labelLengthFormatter={2}, label={124}, label will present '99+'
Receives a number from 1 to 4, representing the label's max digit length
LabelFormatterValues
#
labelStyleAdditional styles for the badge label
TextStyle
#
onPressCalled when the badge is pressed
(props: any) => void
#
sizeBadge's size
number