Components

Avatar

A circular image container with an accessible fallback for representing users and entities.

Loading...

Installation

Install the registry item directly, then add any package dependencies if you are setting the component up manually.

1

Install the component

Run the registry command below to add avatar to your project.

watermelon add avatar
2

Install manual dependencies

If you are wiring the component manually, install the package dependencies shown below.

npm install @rn-primitives/avatar
3

Import the component

Import Avatar from your local UI registry output.

Import

import { Avatar } from "@/components/ui/avatar";

Import

Import

import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";
import { Text } from "@/components/ui/text";

Usage

The Avatar primitive uses @rn-primitives/avatar for lazy loading with an accessible AvatarFallback shown before the image resolves.

With Image

Provide a src to load a remote image for the avatar.

Loading...

Fallback Only

When no image is provided, AvatarFallback always renders.

Loading...

Custom Sizes

Override the default 40×40 size with NativeWind classes.

Loading...

API Reference

proptypedefaultdescription
srcstring-Image source URI passed to AvatarImage.
altstring-Accessible label for the avatar image.
classNamestring-Override classes on the Avatar root container.