Primitives
Animated Number Avatar Badge Button Button Group Toggle Toggle Group Checkbox Chip Countdown Divider Fab Grid Icon Image Input Search Input Textarea Label Loader Marquee Masked Input Message Bubble Notification Banner Offline Banner Progress Progress Ring Radio Group Range Slider Rating Separator Skeleton Slider Stack Stepper Switch Text Theme Toggle Ticker Typing IndicatorComposed
Accordion Achievement Badge Action Bar Action Sheet Action Swap Activity Rings Add to Cart Button Address Card Agenda List Alert Amount Keypad Animated Icons App Bar Audio Message Audio Recorder Autocomplete Avatar Group Balance Display Bar List Barcode Before After Biometric Gate Bloom Menu Bottom Sheet Paywall Sheet Side Sheet Breadcrumb Calendar Calendar Strip Card Carousel Cart Item Character Charts Chat Composer Chat List Item Choice Card Circle Reveal Coach Marks Collapsible Collapsible Header Color Picker Combobox Command Palette Comment Thread Confetti Consent Sheet Context Menu Copy Field Country Picker Coupon Input Currency Input Data Table Date Range Picker Day Schedule Dialog Dock Donut Chart Drawer Driver Card Dropdown Menu Drum Picker Emoji Picker Empty State Error State Event Card Expandable Control Fader Feature Gate File Picker Filter Bar Follow Button Form Gauge Glass Glass Cluster Glass Dock Morph Glass Fab Morph Glass Lab Glass Orb Glass Search Morph Glass Sheet Edge Gradient Button Headline New Heatmap Image Cropper Image Viewer Kanban Card Keyboard Avoiding Keyboard Toolbar Leaderboard Level Progress Lightbox Like Button Line Chart List Reorderable List Swipeable Row Location Card Location Search Map Sheet Map View Markdown View Media Controls Media Picker Media Tile Mention Input Meter Bar Mini Player Mood Slider Morphing Modal Multi Select Navigation Rail Notification Item Number Input Onboarding Pager Order Card Order Summary OTP Input Pagination Paper Clip New Parallax Header Pass Card Password Strength Payment Button Payment Card Payment Method Permission Primer Phone Input PIN Pad Polaroid New Poll Popover Post Card Postage Stamp New Price Tag Pricing Table Product Card Product Gallery Profile Header Promo Banner Prompt Input Property Card Pull To Refresh QR Code Quick Actions Quick Replies Rating Summary Reaction Picker Resend Timer Review Card Review Prompt Ride Option Save Button Scan Frame Scroll Spy Tabs Seat Map Section Header Section Index Segmented Control Select Share Button Share Sheet Shutter Button Signature Pad Slide to Confirm Slot Picker Smart Banner Social Login Button Sparkline Splash Screen Split Button Stat Card Stateful Button Status Dot Step Flow Steps Sticker New Stopwatch Stories Progress Stories Viewer Story Ring Streak Counter Streaming Text Success Seal Swipe Deck Tabs Tag Input Tape New Text Reveal Thinking Indicator Time Picker Timeline Timer Ring Tip Selector Toast Toolbar Tooltip Track Row Transaction Row Trip Progress Variant Picker Video Controls Waveform Weather Card Weekday Picker Zoom TransitionScreens
Account Switcher Biometric Setup Delete Account Forgot Password Grow Auth Login Login — Dark Stage Login — Dense Work Login — Editorial Login — Illustrated Login — Minimal Ink Login — Social Login — Video Loop Food Onboarding Onboarding Onboarding Dark Objects Onboarding Editorial Onboarding Illustrated Onboarding Personalize Onboarding Photo Carousel OTP Verification Passkey — Create Password Reset Permission — Notifications Phone Verification Onboarding Quiz Session Devices Signup Sign-up Chat Sign-up Photo Sheet Social Auth Split Auth Verify Identity Welcome AI Chat AI Assistant Channels List Chat Info Chat List Chat Media Chat Thread Create Group Group Info Message Requests New Message Kept Messages Accessibility Activity Log Appearance Authenticator Blocked Accounts Export Your Data Downloads Edit Profile Edit Profile — Rows Emergency Call Empty States Set Error State Send Feedback Device Locator Help Center Home — Bento Home — Dark Home — Editorial Home Feed Invite Friends Language & Region Linked Accounts Not Found (404) Notification Settings Notifications Password Vault Paywall Paywall — Comparison Paywall — Dark Stage Paywall — Editorial Paywall — Photo Paywall — Trial Timeline Privacy Profile Profile — Gamified Profile — Minimal Profile — Photo Hero QR Scanner Report Issue Saved Items Phone Time Search Search — Command Palette Search — Visual Account Health Settings Settings — Dark Device Settings — Search Storage & Data Terms & Privacy Dating Chat Dating Filters Profile Discover Its A Match Into You Matches Profile Detail Profile Editor Courier Matching Delivery History Delivery Support Package Schedule Parcel Tracking Proof Of Delivery Quick Aisle Quick Home Send Package Substitutions Add Payment Address Book Cart Categories Checkout Checkout — Steps Checkout Success Delivery Filters & Sort Flash Sale Gift Cards Loyalty Points Order Cancel Order Detail Orders Pay Later Checkout Payment Methods Product Detail Product Detail — Hero Product Grid Product Reviews Promo Codes Recently Viewed Return Items Search Results Shop Assistant Store Home Tip & Rate Courier Order Tracking Wishlist Write a Review Event Checkin Event Hero Events Discover My Tickets Seat Selection Ticket Checkout Add Card Bank Accounts Dashboard — Bento Bill Pay Budgets Card Details Crypto Portfolio Finance Dashboard Dashboard — Dark Exchange Currency Expense List Invoice Detail Manage Cards Plan Management Savings Goals Send Money Spending Analytics Split Bill Subscriptions Token Detail Token Swap Transactions Wallet Home Wallet Movers Courier Tracking Food Cart Food Home Food Orders Grocery List Recipe Detail Restaurant — Dark Restaurant Detail Activity Rings Fitness Home Habit Quest Habit Tracker Meal Planner Med Store Meditation Player Mood Check-in Nutrition Home Period Tracker Prior Auth Prior Auth Cases Quest Complete Run Tracking Rx Scan Sleep Tracker Telehealth Booking Walk Map Water Tracker Workout Complete Workout Detail Workout Session Applications Apply Company Interview Schedule Job Detail Job Feed Resume Saved Jobs Create Listing Item Chat Listing Detail Make Offer Market Checkout Market Home Market Search My Listings Offers Inbox Seller Profile Audiobook Player Camera Gallery Albums Game Store Mini Player Music Player Photo Editor Photo Gallery Playlist Detail Podcast Player Clips Feed Serene Home Sound Mixer Stories Video Call Video Player Article Reader Course Detail Event Detail Memory Onboarding Icon Lab Leaderboard Lesson Player Match Detail News Editorial News Home Plant Care Prediction Live Prediction Welcome Smart Home Standings Ticket Wallet Topics Follow Weather Detail Add Task Sheet Alarm Clock Calendar Day Calendar Month Doc Scanner File Manager Focus Timer Journal Kanban Board Mail Inbox Mail Thread Note Editor Notes List Reminders Task List Time Blocks Agent Profile Compare Homes Mortgage Calculator Property Detail Rental Application Saved Homes Schedule Tour Search List Search Map Complete Destination Driver Arriving Ev Charging History Home In Trip Matching Options Parking Receipt Safety Schedule Scooter Unlock Booking Confirmed Booking Review Booking Slots My Bookings Pro On The Way Provider Detail Provider List Rate Service Services Home Arc Create Arc Detail Arc Onboarding Avatar Creator Comments Sheet Create Post Explore Grid Followers List Hashtag Feed Mentions Post Detail Post Hero Social Profile Boarding Pass Booking Confirm Car Rental Trip Discover Flight Live Flight Preferences Flight Results Flight Search Hotel Detail Live Transit Trip — Map Day Trip — Rideshare Request Seat Select Travel Home Trip Itinerary Trip OnboardingNothing matches — try another word.
Avatar
Circular profile image with fallback initials and a presence dot. An optional mode shows presence on the photo itself, bright when online and faded when away or offline.
Preview
import * as React from "react";
import { forwardRef, useState } from "react";
import { View, Text, type ViewProps, type ImageSourcePropType, type GestureResponderEvent, } from "react-native";
import Animated, {
useSharedValue,
useAnimatedStyle,
withSpring,
withTiming,
Easing,
} from "react-native-reanimated";
import { cn, createVariant, useHaptic, usePressAnimation, useReducedMotion, AnimatedPressable, spring, ease, timing } from "@lumioui/core";
import { Icon } from "../icon";
const avatarVariants = createVariant({
base: "items-center justify-center overflow-hidden rounded-full bg-muted",
variants: {
size: {
sm: "h-8 w-8",
md: "h-10 w-10",
lg: "h-14 w-14",
xl: "h-20 w-20",
},
},
defaultVariants: { size: "md" },
});
const statusColors = {
online: "bg-success",
offline: "bg-muted-foreground",
busy: "bg-destructive",
away: "bg-warning",
} as const;
/** Wrapper box for the dot — same footprint as the circle so the corner dot
* sits on the rim whatever the parent alignment is. */
const boxSize = { sm: "h-8 w-8", md: "h-10 w-10", lg: "h-14 w-14", xl: "h-20 w-20" } as const;
const dotSize = { sm: "h-2.5 w-2.5", md: "h-3 w-3", lg: "h-3.5 w-3.5", xl: "h-4 w-4" } as const;
// Fallback initials track the avatar size — xl with md text looked lost.
const fallbackTextSize = {
sm: "text-xs",
md: "text-sm",
lg: "text-lg",
xl: "text-2xl",
} as const;
const fallbackIconSize = { sm: "sm", md: "md", lg: "lg", xl: "xl" } as const;
/** Image settle — the photo fades in while shrinking from a hair oversized,
* so it reads as landing in the well rather than snapping on (content
* reveal: short lift, decelerating ease). */
const IMAGE_SETTLE = { duration: timing.normal.duration, easing: Easing.bezier(...ease.out) };
export interface AvatarProps extends ViewProps {
size?: "sm" | "md" | "lg" | "xl";
/** Image source for the avatar — fades in when it loads. */
source?: ImageSourcePropType;
/** Fallback initials shown when no image (or it fails). */
fallback?: string;
/** Presence dot in the corner — chat/status lists. */
status?: keyof typeof statusColors;
/** Makes the avatar tappable (profile → detail). */
onPress?: (e: GestureResponderEvent) => void;
className?: string;
/** Accessibility label — defaults to "Avatar". */
alt?: string;
/**
* Presence as light (opt-in): the photo is switched on by presence — full
* when online or busy, dimmed under a surface veil when away (80%) or
* offline (60%) — and the dot gets a shape per state (filled online,
* hollow away, barred busy, hollow grey offline). Default false.
*/
lit?: boolean;
}
/** Lit mode: how much of the photo is "on" per presence state. */
const PRESENCE_LIGHT: Record<keyof typeof statusColors, number> = {
online: 1,
busy: 1,
away: 0.8,
offline: 0.6,
};
/** Switching on is quick; dimming away is a calmer shift. */
const PRESENCE_ON = { duration: timing.fast.duration, easing: Easing.bezier(...ease.out) };
const PRESENCE_DIM = { duration: timing.normal.duration, easing: Easing.bezier(...ease.inOut) };
/** Lit-mode dot fill per state — hollow states are rings, busy carries a bar. */
const litDotInner = {
online: "bg-success",
away: "border-2 border-warning",
busy: "bg-destructive items-center justify-center",
offline: "border-2 border-muted-foreground",
} as const;
/**
* Avatar — image fades in on load, initials fallback with person glyph,
* optional presence dot, optional press with spring + haptic. Opt-in `lit`
* makes presence a light: the photo switches on when online and dims when
* away or offline, and the dot takes a shape per state.
*/
export const Avatar = forwardRef<React.ElementRef<typeof View>, AvatarProps>(
function Avatar(
{ size = "md", source, fallback, status, onPress, className, alt = "Avatar", lit = false, ...props },
ref
) {
const [failed, setFailed] = useState(false);
const haptics = useHaptic();
const reduce = useReducedMotion();
const press = usePressAnimation({ pressedScale: 0.94 });
const showImage = source && !failed;
const fade = useSharedValue(0);
// settleT: 0 = just loaded (slightly oversized), 1 = at rest.
const settleT = useSharedValue(0);
const imageStyle = useAnimatedStyle(() => ({
opacity: fade.value,
transform: [{ scale: 1.08 - settleT.value * 0.08 }],
}));
// A new image source gets a fresh chance to load.
const sourceKey =
source && typeof source === "object" && !Array.isArray(source) && "uri" in source
? source.uri
: source;
React.useEffect(() => {
setFailed(false);
}, [sourceKey]);
// Presence dot: present at rest on first paint (a list of avatars must
// not pop all at once), then ignites on spring.swap when the status
// actually changes — the motion marks the change, not the mount.
const dotPop = useSharedValue(status ? 1 : 0);
const prevStatus = React.useRef(status);
React.useEffect(() => {
if (prevStatus.current === status) return;
prevStatus.current = status;
if (!status) {
dotPop.value = 0;
return;
}
if (reduce) {
dotPop.value = 1;
return;
}
dotPop.value = 0;
dotPop.value = withSpring(1, spring.swap);
}, [status, reduce, dotPop]);
const dotStyle = useAnimatedStyle(() => ({
opacity: dotPop.value,
transform: [{ scale: 0.4 + dotPop.value * 0.6 }],
}));
// Lit mode: presence is light on the photo. A surface veil dims it
// toward the card for away/offline; opacity only, so reduced motion
// keeps it.
const veilT = useSharedValue(1 - (status ? PRESENCE_LIGHT[status] : 1));
React.useEffect(() => {
if (!lit) return;
const target = 1 - (status ? PRESENCE_LIGHT[status] : 1);
veilT.value = withTiming(target, target < veilT.value ? PRESENCE_ON : PRESENCE_DIM);
}, [lit, status, veilT]);
const veilStyle = useAnimatedStyle(() => ({ opacity: veilT.value }));
const veil = lit ? (
<Animated.View pointerEvents="none" style={veilStyle} className="absolute inset-0 bg-card" />
) : null;
const dot = status ? (
lit ? (
// Shape per state — presence never rides on colour alone.
<Animated.View
pointerEvents="none"
style={dotStyle}
className={cn("absolute bottom-0 right-0 rounded-full border-2 border-card bg-card", dotSize[size])}
accessibilityElementsHidden
aria-hidden
>
<View className={cn("flex-1 rounded-full", litDotInner[status])}>
{status === "busy" ? <View className="w-1/2 rounded-full bg-destructive-foreground" style={{ height: 2 }} /> : null}
</View>
</Animated.View>
) : (
<Animated.View
pointerEvents="none"
style={dotStyle}
className={cn(
// Ring matches the surface avatars almost always sit on (list rows,
// cards) so the dot reads as cut out of the photo.
"absolute bottom-0 right-0 rounded-full border-2 border-card",
dotSize[size],
statusColors[status]
)}
accessibilityElementsHidden
aria-hidden
/>
)
) : null;
const content = (
<>
{showImage ? (
<>
{/* Initials stay under the image until it loads — no blank flash */}
<Text
className={cn("absolute font-semibold leading-tight text-muted-foreground", fallbackTextSize[size])}
allowFontScaling={false}
>
{(fallback ?? "?").slice(0, 2).toUpperCase()}
</Text>
<Animated.Image
source={source}
className="h-full w-full"
style={imageStyle}
onLoad={() => {
if (reduce) {
fade.value = 1;
settleT.value = 1;
} else {
fade.value = withTiming(1, timing.normal);
settleT.value = withTiming(1, IMAGE_SETTLE);
}
}}
onError={() => setFailed(true)}
accessibilityIgnoresInvertColors
/>
</>
) : fallback ? (
<Text className={cn("font-semibold leading-tight text-muted-foreground", fallbackTextSize[size])} allowFontScaling={false}>
{fallback.slice(0, 2).toUpperCase()}
</Text>
) : (
<Icon name="user" size={fallbackIconSize[size]} color="mutedForeground" />
)}
{veil}
</>
);
const container = cn(avatarVariants({ size }), className);
const a11y = {
accessibilityLabel: alt,
accessibilityRole: (onPress ? "button" : "image") as "button" | "image",
};
// The circle clips its photo (overflow-hidden), so the presence dot lives
// on an unclipped wrapper — inside the circle the corner dot was masked
// down to a sliver.
const withDot = (node: React.ReactElement) =>
dot ? (
<View className={cn("relative", boxSize[size])}>
{node}
{dot}
</View>
) : (
node
);
if (!onPress) {
return withDot(
<View ref={ref} className={container} {...a11y} {...props}>
{content}
</View>
);
}
return withDot(
<AnimatedPressable
ref={ref as never}
onPress={(e) => {
haptics.light();
onPress(e);
}}
// sm/md avatars are below the 44pt target — expand the hit area.
hitSlop={size === "sm" || size === "md" ? 6 : 0}
onPressIn={press.onPressIn}
onPressOut={press.onPressOut}
style={press.animatedStyle}
className={container}
{...a11y}
{...props}
>
{content}
</AnimatedPressable>
);
}
);
Avatar.displayName = "Avatar"; import { Avatar } from "@/components/ui/avatar/avatar";
export function Example() {
return (
<Avatar />
);
} Installation
Usage
import { Avatar } from "@/components/ui/avatar/avatar"; <Avatar /> Examples
Contacts imported without photos: initials hold the circle, and an unsaved number falls back to the person glyph.
import * as React from "react";
import { View } from "react-native";
import { Avatar } from "../avatar";
import { Button } from "../../button/button";
import { Text } from "../../text/text";
const CONTACTS: { fallback?: string; name: string; meta: string }[] = [
{ fallback: "RO", name: "Rosa Okonkwo", meta: "(510) 555-0148" },
{ fallback: "TB", name: "Tobias Brandt", meta: "[email protected]" },
{ fallback: "WL", name: "Wen Li", meta: "(415) 555-0193" },
{ name: "(628) 555-0117", meta: "No name saved" },
];
/** AvatarFallback — contacts imported without photos: initials hold the
* circle, and an unsaved number falls back to the person glyph. Invite
* someone and the row confirms. */
export function AvatarFallback() {
const [invited, setInvited] = React.useState<Set<string>>(() => new Set());
return (
<View className="w-full gap-2">
<Text className="px-4 text-[13px] text-muted-foreground">From your contacts</Text>
<View className="w-full overflow-hidden rounded-2xl bg-card">
{CONTACTS.map((c, i) => {
const done = invited.has(c.name);
return (
<View key={c.name} className="flex-row items-center gap-3 pl-4">
<Avatar size="md" fallback={c.fallback} alt={c.name} />
<View
className={`flex-1 flex-row items-center gap-3 py-3 pr-4 ${i > 0 ? "border-t border-border" : ""}`}
>
<View className="flex-1">
<Text className="text-base font-medium" numberOfLines={1}>{c.name}</Text>
<Text variant="muted" numberOfLines={1}>{c.meta}</Text>
</View>
<Button
size="sm"
variant={done ? "ghost" : "secondary"}
disabled={done}
onPress={() => setInvited((s) => new Set(s).add(c.name))}
accessibilityLabel={done ? `${c.name} invited` : `Invite ${c.name}`}
>
{done ? "Invited" : "Invite"}
</Button>
</View>
</View>
);
})}
</View>
</View>
);
} A team list in a chat app.
import * as React from "react";
import { Pressable, View } from "react-native";
import { useHaptic } from "@lumioui/core";
import { Avatar } from "../avatar";
import { Icon } from "../../icon/icon";
import { Text } from "../../text/text";
type Status = "online" | "away" | "busy" | "offline";
const MY_STATUS: { status: Status; label: string }[] = [
{ status: "online", label: "Active" },
{ status: "away", label: "Away" },
{ status: "busy", label: "Do not disturb" },
{ status: "offline", label: "Appear offline" },
];
const TEAM: { img: number; fallback: string; name: string; status: Status; meta: string }[] = [
{ img: 5, fallback: "JW", name: "Jonah Whitfield", status: "online", meta: "Reviewing the onboarding flow" },
{ img: 26, fallback: "MA", name: "Mireille Asante", status: "busy", meta: "In a meeting until 3:00 PM" },
{ img: 53, fallback: "KS", name: "Kofi Sarpong", status: "away", meta: "Back in 20 min" },
{ img: 41, fallback: "IL", name: "Ines Laurent", status: "offline", meta: "Last active yesterday" },
];
/** AvatarPresence — a team list in a chat app. Presence is light: online
* faces are fully on, away and offline faces sit dimmer, and each dot has
* its own shape. Tap your own row to cycle your status and watch your
* photo switch on or dim with it; teammates show theirs. */
export function AvatarPresence() {
const haptics = useHaptic();
const [mine, setMine] = React.useState(0);
const me = MY_STATUS[mine]!;
return (
<View className="w-full gap-6">
<Pressable
onPress={() => {
haptics.selection();
setMine((i) => (i + 1) % MY_STATUS.length);
}}
className="flex-row items-center gap-3 rounded-2xl bg-card p-4"
accessibilityRole="button"
accessibilityLabel={`Your status: ${me.label}. Tap to change`}
>
<Avatar size="lg" source={{ uri: "https://i.pravatar.cc/150?img=68" }} fallback="SV" status={me.status} alt="You" lit />
<View className="flex-1">
<Text className="text-[17px] font-semibold">Sam Varga</Text>
<Text variant="muted">{me.label}</Text>
</View>
<Icon name="chevron-down" size="sm" color="mutedForeground" />
</Pressable>
<View className="gap-2">
<Text className="px-4 text-[13px] text-muted-foreground">Design team</Text>
<View className="w-full overflow-hidden rounded-2xl bg-card">
{TEAM.map((p, i) => (
<View key={p.name} className="flex-row items-center gap-3 pl-4">
<Avatar
source={{ uri: `https://i.pravatar.cc/150?img=${p.img}` }}
fallback={p.fallback}
status={p.status}
lit
alt={`${p.name}, ${p.status}`}
/>
<View className={`flex-1 py-3 pr-4 ${i > 0 ? "border-t border-border" : ""}`}>
<Text className="text-base font-medium">{p.name}</Text>
<Text variant="muted" numberOfLines={1}>{p.meta}</Text>
</View>
</View>
))}
</View>
</View>
</View>
);
} Each size in the spot it owns on a maker's profile: xl in the header, sm on the "followed by" line, lg on the event row, md in the comments.
import * as React from "react";
import { View } from "react-native";
import { Avatar } from "../avatar";
import { Button } from "../../button/button";
import { Icon } from "../../icon/icon";
import { Text } from "../../text/text";
const COMMENTS = [
{ img: 9, f: "MK", name: "Mina Kaur", body: "That celadon glaze is unreal. Is it a cone 6 recipe?" },
{ img: 13, f: "DP", name: "Dev Patel", body: "Picked up two cups at the market. Even better in person." },
];
/** AvatarSizes — each size in the spot it owns on a maker's profile: xl in
* the header, sm on the "followed by" line, lg on the event row, md in the
* comments. Tap Follow and the follower line updates. */
export function AvatarSizes() {
const [following, setFollowing] = React.useState(false);
return (
<View className="w-full gap-5 rounded-3xl bg-card p-5">
<View className="flex-row items-center gap-4">
<Avatar size="xl" source={{ uri: "https://i.pravatar.cc/150?img=32" }} fallback="AL" alt="Ama Lindqvist" />
<View className="flex-1 gap-1">
<Text className="text-2xl font-bold tracking-tight">Ama Lindqvist</Text>
<Text variant="muted">Ceramicist · Malmö</Text>
</View>
</View>
<View className="flex-row items-center gap-2">
<View className="flex-row">
<Avatar size="sm" source={{ uri: "https://i.pravatar.cc/150?img=15" }} fallback="JT" alt="Jun Takeda" />
<View className="-ml-2 rounded-full border-2 border-card" style={{ marginVertical: -2 }}>
<Avatar size="sm" source={{ uri: "https://i.pravatar.cc/150?img=44" }} fallback="RV" alt="Ruth Vega" />
</View>
</View>
<Text variant="muted" className="flex-1" numberOfLines={1}>
{following ? "Followed by you, Jun and 214 others" : "Followed by Jun, Ruth and 214 others"}
</Text>
</View>
<Button size="lg" variant={following ? "secondary" : "default"} onPress={() => setFollowing((f) => !f)}>
{following ? "Following" : "Follow"}
</Button>
<View className="flex-row items-center gap-3 rounded-2xl bg-secondary p-3">
<Avatar size="lg" source={{ uri: "https://i.pravatar.cc/150?img=59" }} fallback="OB" alt="Olu Bankole" />
<View className="flex-1">
<Text className="text-[15px] font-semibold">Studio visit with Olu Bankole</Text>
<Text variant="muted">Live Thursday · 7:00 PM</Text>
</View>
<Icon name="bell" size="md" color="foreground" accessibilityLabel="Remind me" />
</View>
<View className="gap-4 border-t border-border pt-4">
{COMMENTS.map((c) => (
<View key={c.name} className="flex-row gap-3">
<Avatar size="md" source={{ uri: `https://i.pravatar.cc/150?img=${c.img}` }} fallback={c.f} alt={c.name} />
<View className="flex-1 gap-1">
<Text className="text-sm font-semibold">{c.name}</Text>
<Text className="text-[15px] leading-5">{c.body}</Text>
</View>
</View>
))}
</View>
</View>
);
} API reference
size "sm" | "md" +2
"sm" | "md" | "lg" | "xl" "md" source ImageSourcePropType Image source for the avatar — fades in when it loads.
—fallback string Fallback initials shown when no image (or it fails).
—status keyof typeof statusColors Presence dot in the corner — chat/status lists.
—onPress (e: GestureResponderEvent) => void Makes the avatar tappable (profile → detail).
—className string — alt string Accessibility label — defaults to "Avatar".
"Avatar" lit boolean Presence as light (opt-in): the photo is switched on by presence — full when online or busy, dimmed under a surface veil when away (80%) or offline (60%) — and the dot gets a shape per state (filled online, hollow away, barred busy, hollow grey offline). Default false.
false