Components

Avatar

User avatar component with image, initials fallback, status indicator, and pressable support.

iOSAndroid
Preview Avatar on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-avatar

Usage

import { Avatar } from '@/components/docyrus-native/avatar';

<Avatar uri="https://i.pravatar.cc/150?img=1" size="lg" />
<Avatar name="John Doe" variant="soft" status="online" />
<Avatar name="AB" shape="rounded" variant="outline" />

API Reference

PropTypeDefaultDescription
uristring—Image URI for the avatar
namestring—Name used to generate initials fallback
shape'circle' | 'rounded''circle'Avatar shape
size'xs' | 'sm' | 'md' | 'lg''md'Avatar size
variant'solid' | 'soft' | 'outline''solid'Background style variant
status'none' | 'online' | 'offline' | 'busy' | 'away''none'Status indicator dot
onPress() => void—Press handler (wraps in Pressable)
classNamestring—Additional CSS classes
textClassNamestring—Initials text CSS classes

Type Exports

TypeDescription
AvatarPropsProps for Avatar component
AvatarShape'circle' | 'rounded'
AvatarSize'xs' | 'sm' | 'md' | 'lg'
AvatarVariant'solid' | 'soft' | 'outline'
AvatarStatus'none' | 'online' | 'offline' | 'busy' | 'away'

On this page