Skip to content

Avatar

Avatar Primitive

Demo


An image component featuring an alternative representation for depicting the user.

Installation

Terminal window
npx @react-native-reusables/cli@latest add avatar

Usage

import { Avatar, AvatarFallback, AvatarImage } from '~/components/ui/avatar';
import { Text } from '~/components/ui/text';
const GITHUB_AVATAR_URI = 'https://github.com/mrzachnugent.png';
function Example() {
return (
<Avatar alt="Zach Nugent's Avatar">
<AvatarImage source={{ uri: GITHUB_AVATAR_URI }} />
<AvatarFallback>
<Text>ZN</Text>
</AvatarFallback>
</Avatar>
);
}

Props

Avatar

Extends View props

PropTypeNote
alt *string
asChildboolean(optional)

AvatarImage

Extends Image props except alt

PropTypeNote
asChildboolean(optional)

AvatarFallback

Extends View props

PropTypeNote
asChildboolean(optional)