ZUI

Search documentation

Find a page or a heading.

Avatar

A round picture of a person or an account, with a fallback that shows until the image has loaded.

Installation

bash

The CLI writes components/ui/avatar.tsx, installs Text and Utils, and adds @rn-primitives/avatar.

Usage

tsx
tsx

API reference

Avatar

Takes every prop of the @rn-primitives/avatar root, plus:

alt names the avatar. The image carries it, and so does the fallback while it stands in. sm draws 24px, lg 40px, and the default is 32px.

AvatarImage

Takes every prop of the @rn-primitives/avatar image. It draws nothing if it fails to load.

AvatarFallback

Shows until the image has loaded, and for good when there is no image or it failed. Its child is usually initials as a Text. It is announced as an image named by the avatar's alt.