Avatar
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} />; }
| Prop | Type | Default | Description |
|---|---|---|---|
source | ImageSourcePropType | undefined | — | — |
iconName | string | undefined | — | — |
iconType | "material-community" | "feather" | undefined | — | — |
iconProps | Omit<IconProps, "ref" | "name" | "type"> | undefined | — | — |
label | string | undefined | — | — |
labelProps | Omit<TextProps, "children"> | undefined | — | — |
imageProps | Omit<ImageProps, "source"> | undefined | — | — |
color | string | undefined | — | — |
size | string | number | undefined | — | — |