Avatar
Avatar component for displaying user profile images
(code example)
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β
animateβ
Adds fade in animation when Avatar image loads
boolean
autoColorsConfigβ
Send this to use the name to infer a backgroundColor
AutoColorsProps
backgroundColorβ
Background color for Avatar
string
badgePositionβ
Badge location on Avatar
TOP_RIGHT | TOP_LEFT | BOTTOM_RIGHT | BOTTOM_LEFT
badgePropsβ
Badge props passed down to Badge component
BadgeProps
containerStyleβ
Additional spacing styles for the container
ViewStyle
customRibbonβ
Custom ribbon
JSX.Element
imagePropsβ
Image props object
ImageProps
imageStyleβ
Image style object used to pass additional style props by components which render image
ImageStyle
isOnlineβ
Determine if to show online badge
boolean
labelβ
Label that can represent initials
string
labelColorβ
The label color
string
nameβ
The 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
onImageLoadEndβ
Listener-callback for when an image's (uri) loading either succeeds or fails (equiv. to Image.onLoadEnd()).
ImagePropsBase['onLoadEnd']
onImageLoadErrorβ
Listener-callback for when an image's (uri) loading fails (equiv. to Image.onError()).
ImagePropsBase['onError']
onImageLoadStartβ
Listener-callback for when an image's (uri) loading starts (equiv. to Image.onLoadStart()).
ImagePropsBase['onLoadStart']
onPressβ
Press handler
(props: any) => void
ribbonLabelβ
Ribbon label to display on the avatar
string
ribbonLabelStyleβ
Ribbon label custom style
TextStyle
ribbonStyleβ
Ribbon custom style
ViewStyle
sizeβ
Custom size for the Avatar
number
sourceβ
The image source (external or from assets)
ImageSourcePropType
statusβ
AWAY, ONLINE, OFFLINE or NONE mode (if set to a value other then 'NONE' will override isOnline prop)
StatusModes
testIDβ
Test identifier
string
useAutoColorsβ
Hash the name (or label) to get a color, so each name will have a specific color. Default is false.
boolean