Avatar
Avatar component for displaying user profile images
(code example)
info
This component extends TouchableOpacity, Image props.
#
Usage<Avatar source={{uri: 'https://lh3.googleusercontent.com/-cw77lUnOvmI/AAAAAAAAAAI/AAAAAAAAAAA/WMNck32dKbc/s181-c/104220521160525129167.jpg'}} label={IT}/>
#
API#
animateAdds fade in animation when Avatar image loads
boolean
#
autoColorsConfigSend this to use the name to infer a backgroundColor
AutoColorsProps
#
backgroundColorBackground color for Avatar
string
#
badgePositionBadge location on Avatar
TOP_RIGHT | TOP_LEFT | BOTTOM_RIGHT | BOTTOM_LEFT
#
badgePropsBadge props passed down to Badge component
BadgeProps
#
containerStyleAdditional spacing styles for the container
ViewStyle
#
customRibbonCustom ribbon
JSX.Element
#
imagePropsImage props object
ImageProps
#
imageStyleImage style object used to pass additional style props by components which render image
ImageStyle
#
isOnlineDetermine if to show online badge
boolean
#
labelLabel that can represent initials
string
#
labelColorThe label color
string
#
nameThe name of the avatar user. If no label is provided, the initials will be generated from the name. autoColorsConfig will use the name to create the background color of the Avatar.
string
#
onImageLoadEndListener-callback for when an image's (uri) loading either succeeds or fails (equiv. to Image.onLoadEnd()).
ImagePropsBase['onLoadEnd']
#
onImageLoadErrorListener-callback for when an image's (uri) loading fails (equiv. to Image.onError()).
ImagePropsBase['onError']
#
onImageLoadStartListener-callback for when an image's (uri) loading starts (equiv. to Image.onLoadStart()).
ImagePropsBase['onLoadStart']
#
onPressPress handler
(props: any) => void
#
ribbonLabelRibbon label to display on the avatar
string
#
ribbonLabelStyleRibbon label custom style
TextStyle
#
ribbonStyleRibbon custom style
ViewStyle
#
sizeCustom size for the Avatar
number
#
sourceThe image source (external or from assets)
ImageSourcePropType
#
statusAWAY, ONLINE, OFFLINE or NONE mode (if set to a value other then 'NONE' will override isOnline prop)
StatusModes
#
testIDTest identifier
string
#
useAutoColorsHash the name (or label) to get a color, so each name will have a specific color. Default is false.
boolean