# Avatar — React Native component for Expo

> A photo over hashed-colour initials, with presence dots and badges cut into the edge.

Photo that fades in over soft tinted initials (hue hashed from the name, ink picked for contrast), presence dots, notification badges and a verified seal cut into the edge, a gapped story ring that cross-fades to “seen”, and an AvatarGroup with cut-out borders, a +N chip and a staggered spring-in.

- Docs: https://expokit.in/docs/components/avatar
- Tier: Free
- Also called: profile picture, user avatar, avatar group
- Category: Display
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: react-native-svg, expo-haptics
- Uses ExpoKit items: kit
- Variants: Profile Header, Chat List, Stories, Group, Fallbacks, Sizes, Status, Badges

## Installation

Run once per project: `npx @expokit/cli@latest init` (shared theme + KitProvider). Then:

```bash
npx @expokit/cli@latest add avatar
```

The CLI copies the source into your project (you own the code) and installs react-native-svg, expo-haptics.

Import: `import { Avatar } from "@/components/ui/avatar";`

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `src` | `string` | — | Image URL. Fades in over the initials; falls back to them on error. |
| `name` | `string` | — | Initials, the deterministic fallback colour and the accessibility label. |
| `size` | `"xs" \| "sm" \| "md" \| "lg" \| "xl" \| number` | `"md"` | 24 / 32 / 40 / 56 / 72pt, or any number. |
| `shape` | `"circle" \| "rounded"` | `"circle"` | Circle or rounded square (follows the kit radius). |
| `fallback` | `"soft" \| "solid" \| "gradient"` | `"soft"` | Soft tint with deep ink, flat fill, or an opt-in two-tone gradient. |
| `status` | `"online" \| "away" \| "busy" \| "offline"` | — | Presence dot in a ring cut-out: filled, crescent, bar, hollow. |
| `pulse` | `boolean` | `true when online` | Soft pulse behind the dot (off with reduce motion). |
| `ring` | `"none" \| "story" \| "accent" \| "seen"` | `"none"` | Solid accent ring with a clear gap. "seen" = story + seen. |
| `seen` | `boolean` | `false` | Story watched: the ring cross-fades to a quiet hairline. |
| `ringColors` | `string[]` | `sunset` | Ring colour override; the first entry is used as a solid colour. |
| `ringSpin` | `boolean` | `false` | Broken ring that spins — a loading story (circle only). |
| `verified` | `boolean` | `false` | Rosette seal with a check, bottom-right (bottom-left if a status dot is shown). |
| `badge` | `number \| boolean` | — | Notification count (99+), or true for a dot, top-right. |
| `surface` | `string` | `theme background` | Colour behind the avatar; cut-outs and group borders use it. |
| `accent` | `string` | `theme accent` | Ring and verified seal colour. |
| `elevated` | `boolean` | `true for 72pt+` | Soft drop shadow under the face. |
| `onPress` | `() => void` | — | Makes it a button with spring press feedback. |
| `haptics` | `boolean` | `true` | Light haptic tick on press. |
| `AvatarGroup.max` | `number` | `4` | Avatars shown before the +N chip. |
| `AvatarGroup.total` | `number` | `children count` | Real total when larger than what you pass. |
| `AvatarGroup.overlap` | `number` | `0.28` | Overlap as a fraction of the size. |
| `AvatarGroup.surface` | `string` | `theme background` | Colour of the separating borders — match the parent. |
| `AvatarGroup.animated` | `boolean` | `true` | Staggered spring-in on mount. |
| `AvatarGroup.onPressMore` | `() => void` | — | Makes the +N chip a button. |
| `style` | `StyleProp<ViewStyle>` | — | Style for the avatar root; AvatarGroup applies it to its row. |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## Behaviour & accessibility

- **Motion**: The photo fades in over the initials, a story ring cross-fades to a hairline once seen, and AvatarGroup springs its faces in with a stagger.
- **Touch**: With onPress it becomes a button that springs down while pressed.
- **Reduced motion**: The status pulse, ring spin, press squish and group stagger are skipped, and the seen cross-fade is instant.
- **Haptics**: A light impact on press when onPress is set. Turn off with haptics={false}.
- **Screen readers**: Read as an image (or a button when pressable) labelled with the name plus verified, status, notification and story details. A group reads its first names and "and N more".

## FAQ

### How do I make a profile picture in React Native?

Use ExpoKit's Avatar: run npx @expokit/cli@latest add avatar in your Expo or React Native project and it copies a ready-made profile picture into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Avatar work in Expo Go?

Yes. Avatar runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg, expo-haptics) are all included in Expo Go.

### How do I add Avatar to my Expo app?

Run npx @expokit/cli@latest add avatar in your project. The CLI copies the component's source into your app and installs react-native-svg, expo-haptics, so the code is yours to change.

### Is Avatar free?

Yes. Avatar is free: its full source is on this page and the CLI installs it without an account.

### Can I change how Avatar looks?

Yes. It takes its colours, radius and light / dark mode from useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.

## More

- Live preview, variants and code: https://expokit.in/docs/components/avatar
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
