Data display
Avatar
image + fallback initials
function AvatarDemo() { // `Avatar` rounds the frame but AvatarFallback/AvatarImage round themselves too, // so a square avatar has to square both — hence `square` on each pair below. const square = 'rounded-lg'; const rows = [ { shape: 'Round', radius: '' }, { shape: 'Square', radius: square }, ]; return ( <View className="w-full gap-5"> {rows.map((row) => ( <View key={row.shape} className="gap-2"> <Text className="text-muted-foreground text-xs font-semibold uppercase tracking-wide">{row.shape}</Text> <View className="flex-row flex-wrap items-end gap-5"> <View className="items-center gap-1.5"> <Avatar alt="Expo" className={row.radius}> <AvatarImage source={{ uri: 'https://github.com/expo.png' }} className={row.radius} /> <AvatarFallback className={row.radius}> <Text>EX</Text> </AvatarFallback> </Avatar> <Text className="text-muted-foreground text-xs">Image</Text> </View> <View className="items-center gap-1.5"> <Avatar alt="Jane Doe" className={row.radius}> <AvatarFallback className={row.radius}> <Text>JD</Text> </AvatarFallback> </Avatar> <Text className="text-muted-foreground text-xs">Initials</Text> </View> <View className="items-center gap-1.5"> <Avatar alt="Sam" className={cn('size-8', row.radius)}> <AvatarFallback className={row.radius}> <Text className="text-xs">SO</Text> </AvatarFallback> </Avatar> <Text className="text-muted-foreground text-xs">Small 32</Text> </View> <View className="items-center gap-1.5"> <Avatar alt="Mei" className={cn('size-16', row.radius)}> <AvatarFallback className={row.radius}> <Text className="text-lg">MT</Text> </AvatarFallback> </Avatar> <Text className="text-muted-foreground text-xs">Large 64</Text> </View> </View> </View> ))} </View> );}Usage
Default 48px. Image with initials fallback; size with size-8 / size-16; rounded-lg for a square.
API
<Avatar alt><AvatarImage source /><AvatarFallback><Text /></AvatarFallback></Avatar>Get it
Already in every copy of the native kit:
import { Avatar } from '@/components/ui/avatar';Details
- Exports
Avatar- Packages
- @rn-primitives/avatar@^1.5.2
- Installs with
- @halftone-native/lib-utils
- Also searched as
- profile, user, initials
- Registry JSON
- /r/native/avatar.json
<Row> {['AM', 'JL', 'RK'].map((i) => ( <Avatar key={i}> <AvatarFallback>{i}</AvatarFallback> </Avatar> ))}</Row>API
<Avatar><AvatarImage src alt /><AvatarFallback>AM</AvatarFallback></Avatar>Get it
Already in every copy of the web kit:
import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar';Details
- Exports
Avatar,AvatarImage,AvatarFallback- Upstream
- Unchanged from shadcn/ui; installs from their registry.
Agents: the whole registry is at /llms.txt.