Skip to main content

Avatar

Data Display

Avatar

Circular avatar that falls back to initials or icons when images fail.

Usage

Represent people, organizations, or shared resources in lists and detail views.

Highlights

  • Automatic initials extraction with emoji support
  • Icon fallback for service badges

When to use it

  • User data includes optional profile imagery.
  • You need deterministic placeholders for offline usage.

Examples​

Default​

Preview (Web)
import { Avatar } from 'react-native-molecules/components/Avatar';

export default function Example() {
  const source = {
      uri: 'https://www.eyerys.com/sites/default/files/mark_zuckerberg.jpg'
  };

  return <Avatar size={60} label="Thet Aung" source={source} />;
}
PropTypeDefaultDescription
sourceImageSourcePropType | undefined——
iconNamestring | undefined—Will be used as fallback if source is nullish or image doesn't load
iconTypeIconType | undefined——
iconPropsOmit<IconProps, "ref" | "name" | "type"> | undefined——
labelstring | undefined—Will be used as fallback if link and iconName aren't passed
labelPropsOmit<TextProps, "children"> | undefined——
imagePropsOmit<ImageProps, "source"> | undefined——
colorstring | undefined—Color of the Avatar Will not be visible if there's an image unless the image has transparency Can be color string or token
sizestring | number | undefined—Size of the Avatar Can be a number of a token
Defined in react-native-molecules/components/Avatar