Skip to content

Avatar

Avatar displays a user or entity representation. It supports images, text initials, or icon fallbacks, and can be grouped for showing multiple users.

☯
JD

Displays an icon or emoji when no image or initials are provided.

☯
☰
⚋
<Avatar icon="☯" />
<Avatar icon="☰" />
<Avatar icon="⚋" />

Displays up to 2 characters when no image is available.

JD
AB
YI
<Avatar initials="JD" />
<Avatar initials="AB" />
<Avatar initials="YI" />

Displays a user photo or profile image.

<Avatar source={{ uri: 'https://example.com/photo.jpg' }} />

XS
SM
MD
LG
XL
SizeDimensionUsage
xs24pxInline mentions, compact lists
sm32pxComments, notifications
md40pxDefault, list items
lg56pxProfile headers
xl80pxFull profile view

Display multiple avatars in a stacked layout with overlap.

JD
AB
CD
+3
<AvatarGroup max={3}>
<Avatar initials="JD" />
<Avatar initials="AB" />
<Avatar initials="CD" />
<Avatar initials="EF" />
<Avatar initials="GH" />
<Avatar initials="IJ" />
</AvatarGroup>
A
B
C
JD
AB
CD
<AvatarGroup size="sm">...</AvatarGroup>
<AvatarGroup size="lg">...</AvatarGroup>

Override the default background color for initials/icon avatars.

☯
✓
!
<Avatar icon="☯" backgroundColor={colors['gold-muted']} />
<Avatar icon="✓" backgroundColor={colors['support-success']} />
<Avatar icon="!" backgroundColor={colors['support-error']} />

PropTypeDefaultDescription
sourceImageSourcePropType-Image source
initialsstring-Fallback initials (max 2 chars)
iconstring'☯'Fallback icon/emoji
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'Avatar size
backgroundColorstring-Custom background color
styleViewStyle-Custom styles
accessibilityLabelstring-A11y label
PropTypeDefaultDescription
childrenReactNodeRequiredAvatar elements
maxnumber4Max visible avatars
sizeAvatarSize'md'Size for all avatars
styleViewStyle-Custom styles

import { Avatar, AvatarGroup, Card, Badge } from '@synchronicity/react-native';
import { View, Text } from 'react-native';
function ReadingParticipants({ participants }) {
return (
<Card variant="outlined" padding="md">
<View style={styles.header}>
<Text style={styles.title}>Shared Reading</Text>
<Badge variant="info" size="sm">{participants.length}</Badge>
</View>
<AvatarGroup max={4} size="sm">
{participants.map((p) => (
<Avatar
key={p.id}
source={p.avatar ? { uri: p.avatar } : undefined}
initials={p.initials}
accessibilityLabel={p.name}
/>
))}
</AvatarGroup>
<Text style={styles.names}>
{participants.map(p => p.name).join(', ')}
</Text>
</Card>
);
}