Avatar
Avatars are found all over ui design from lists to profile screens.
They are commonly used to represent a user and can contain photos, icons, or even text.
#
Components- Avatar.Accessory This is used for adding an accessory to the Avatar. Receives either all Icon or Image props.
#
Usage#
Props#
Avatar- Component
- ImageComponent
- activeOpacity
- avatarStyle
- containerStyle
- icon
- iconStyle
- imageProps
- onLongPress
- onPress
- overlayContainerStyle
- placeholderStyle
- renderPlaceholderContent
- rounded
- size
- source
- title
- titleStyle
#
Avatar.Accessory#
Reference#
Avatar#
ComponentComponent for enclosing element (eg: TouchableHighlight, View, etc).
Type | Default |
---|---|
React Component | Pressable or View |
#
ImageComponentCustom ImageComponent for Avatar.
Type | Default |
---|---|
any | None |
#
activeOpacityOpacity when pressed.
Type | Default |
---|---|
number | None |
#
avatarStyleStyle for avatar image.
Type | Default |
---|---|
ImageStyle | None |
#
containerStyleStyling for outer container.
Type | Default |
---|---|
View style(Object) | None |
#
iconDisplays an icon as the main content of the Avatar. Cannot be used alongside title. When used with the source
prop it will be used as the placeholder.
Type | Default |
---|---|
AvatarIcon | None |
#
iconStyleExtra styling for icon component.
Type | Default |
---|---|
Text Style(Object) | None |
#
imagePropsOptional properties to pass to the avatar e.g "resizeMode".
Type | Default |
---|---|
ImageProps(Object) | None |
#
onLongPressCallback function when long pressing component.
Called when a long-tap gesture is detected.
Type | Default |
---|---|
(() => void) and ((event: GestureResponderEvent) => void) | None |
#
onPressCallback function when pressing component.
Called when a single tap gesture is detected.
Type | Default |
---|---|
(() => void) and ((event: GestureResponderEvent) => void) | None |
#
overlayContainerStyleStyle for the view outside image or icon.
Type | Default |
---|---|
Text Style(Object) | None |
#
placeholderStyleAdds style to the placeholder wrapper.
Type | Default |
---|---|
View style(Object) | None |
#
renderPlaceholderContentCustom placeholder element (by default, it's the title).
Type | Default |
---|---|
any | None |
#
roundedMakes the avatar circular.
Type | Default |
---|---|
boolean | None |
#
sizeSize of the avatar.
Type | Default |
---|---|
number or "small" or "medium" or "large" or "xlarge" | small |
#
sourceImage source to be displayed on avatar.
Type | Default |
---|---|
ImageSourcePropType | None |
#
titleRenders title in the placeholder.
Type | Default |
---|---|
string | None |
#
titleStyleStyle for the title.
Type | Default |
---|---|
Text Style(Object) | None |
#
Avatar.Accessory#
styleStyle prop inherited from TextProps and TouchableWithoutFeedbackProperties
Only exist here so we can have ViewStyle or TextStyle
Style
Add custom styling to the accessory of avatar.
Type | Default |
---|---|
Text Style(Object) | None |
#
underlayColorThe color of the underlay that will show through when the touch is active.
Add underlay color to the accessory of avatar.
Type | Default |
---|---|
ColorValue | #000 |