React Native MantineData display

Avatar

User avatar with fallback support

Import: import { Avatar } from 'react-native-mantine';

Usage

import { Avatar } from 'react-native-mantine';

// Avatar with image
<Avatar
  src="https://example.com/avatar.jpg"
  alt="John Doe"
  size="lg"
/>

// Avatar with initials fallback
<Avatar
  alt="Jane Smith"
  color="blue"
  size="md"
/>

// Avatar with custom content
<Avatar size="xl">
  <CustomIcon />
</Avatar>

Props

PropTypeDefaultDescription
srcstring | nullImage URL to display in the avatar. If null or loading fails, placeholder will be shown
altstringImage alt text. Also used to generate initials for placeholder (e.g., "John Doe" becomes "JD")
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | number"md"Avatar size as predefined value or custom number in pixels
radiusnumber | "xs" | "sm" | "md" | "lg" | "xl""xl"Key of theme.radius or any valid number to set border-radius. Use "xl" for circular avatars
colorMantineColor"gray"Avatar background color from theme, used when showing placeholder
childrenReact.ReactNodeCustom placeholder component to show when image is not available. Takes precedence over initials
imagePropsPartial<ImageProps>Additional props passed to the React Native Image component
styleViewStyleAdditional styles to apply to the avatar container

Source on GitHub · npm