Profile with stats and photo grid
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Avatar, Button, Icon, Image, Tabs, TabsList, TabsTrigger, Text } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { Mount, Press, World } from "../shared";
export interface SocialProfileScreenProps {
name?: string;
handle?: string;
bio?: string;
avatarUrl?: string;
/** "1,284" posts / "12.4k" followers / "386" following */
posts?: string;
followers?: string;
following?: string;
photoUrls?: string[];
isOwn?: boolean;
onPostPress?: (index: number) => void;
onFollowers?: () => void;
onBack?: () => void;
}
const pic = (id: string) =>
`https://images.unsplash.com/photo-${id}?w=400&h=400&fit=crop&q=60&auto=format`;
const DEFAULT_PHOTOS = [
"1469334031218-e382a71b716b",
"1445205170230-053b83016050",
"1523381210434-271e8be1f52b",
"1434389677669-e08b4cac3105",
"1544441893-675973e31985",
"1441986300917-64674bd600d8",
"1585208798174-6cedd86e019a",
"1513735492246-483525079686",
"1548707309-dcebeab9ea9b",
"1569959220744-ff553533f492",
"1538332576228-eb5b4c4de6f5",
"1523531294919-4bcd7c65e216",
].map(pic);
/** Social profile — avatar + stats + bio + follow row + photo grid. */
export function SocialProfileScreen({
name = "Amara Chen",
handle = "@amara.makes",
bio = "Design systems by day, film photography by weekend",
avatarUrl = "https://i.pravatar.cc/300?img=47",
posts = "128",
followers = "12.4k",
following = "386",
photoUrls = DEFAULT_PHOTOS,
isOwn = false,
onPostPress,
onFollowers,
onBack,
}: SocialProfileScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [followingBack, setFollowingBack] = React.useState(false);
const [tab, setTab] = React.useState("posts");
return (
<World primary="#65A30D">
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
<View className="flex-row items-center gap-2 px-4 pb-1 pt-2">
<Button
variant="ghost"
size="icon"
haptic="light"
onPress={() => onBack?.()}
accessibilityLabel="Go back"
className="-ml-2 h-10 w-10"
>
<Icon name="chevron-left" size="md" color="foreground" />
</Button>
<Text variant="h3" accessibilityRole="header" numberOfLines={1}>
{handle}
</Text>
</View>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingBottom: insets.bottom + 32 }}
>
{/* Identity — avatar + stat row. */}
<Mount className="flex-row items-center gap-5 px-4 pt-2">
<Avatar
size="xl"
source={{ uri: avatarUrl }}
fallback={name}
alt={name}
/>
<View className="flex-1 flex-row justify-between pl-4">
{[
{ label: "Posts", value: posts, action: undefined },
{ label: "Followers", value: followers, action: onFollowers },
{ label: "Following", value: following, action: onFollowers },
].map((s) =>
s.action ? (
<Press
key={s.label}
haptic="light"
onPress={s.action}
accessibilityRole="button"
accessibilityLabel={`${s.value} ${s.label.toLowerCase()}`}
className="items-center"
>
<Text className="text-lg font-semibold">{s.value}</Text>
<Text className="text-xs text-muted-foreground">{s.label}</Text>
</Press>
) : (
<View key={s.label} className="items-center">
<Text className="text-lg font-semibold">{s.value}</Text>
<Text className="text-xs text-muted-foreground">{s.label}</Text>
</View>
),
)}
</View>
</Mount>
{/* Name + bio. */}
<Mount delay={60} className="gap-0.5 px-4 pt-3">
<Text className="font-semibold">{name}</Text>
<Text className="text-sm text-muted-foreground">{bio}</Text>
{/* Location + tenure — profiles anchor a person in a place. */}
<Text className="pt-0.5 text-[11px] text-muted-foreground/80">
Lisbon · on Lumio since 2021
</Text>
</Mount>
{/* Action row — follow/message for others, edit/share for own. */}
<Mount delay={120} className="mt-4 flex-row gap-2 px-4">
{isOwn ? (
<>
<Button variant="secondary" haptic="light" className="h-9 flex-1">
Edit profile
</Button>
<Button variant="secondary" haptic="light" className="h-9 flex-1">
Share profile
</Button>
</>
) : (
<>
<Button
variant={followingBack ? "secondary" : "default"}
haptic="light"
onPress={() => {
haptics.selection();
setFollowingBack((f) => !f);
}}
accessibilityLabel={followingBack ? "Following" : "Follow"}
accessibilityState={{ checked: followingBack }}
className="h-9 flex-1"
>
{followingBack ? "Following" : "Follow"}
</Button>
<Button
variant="secondary"
haptic="light"
onPress={() => haptics.light()}
accessibilityLabel="Message"
className="h-9 flex-1"
>
Message
</Button>
</>
)}
</Mount>
{/* Tabs — posts / reels / tagged like Instagram. */}
<Mount delay={180} className="px-4 pt-4">
<Tabs
value={tab}
onValueChange={(v) => {
haptics.selection();
setTab(v);
}}
variant="line"
>
<TabsList className="w-full">
<TabsTrigger value="posts" icon="grid" />
<TabsTrigger value="reels" icon="play" />
<TabsTrigger value="tagged" icon="user" />
</TabsList>
</Tabs>
</Mount>
{/* Photo grid — 3-col, the profile's content. */}
<Mount delay={240} className="mt-1 flex-row flex-wrap px-1">
{photoUrls.map((uri, i) => (
<Press
key={uri}
haptic="light"
onPress={() => onPostPress?.(i)}
accessibilityLabel={`Post ${i + 1}`}
className="w-1/3 p-1"
>
<Image
source={{ uri }}
className="aspect-square w-full rounded-2xl bg-muted"
accessibilityLabel={`Photo ${i + 1}`}
/>
</Press>
))}
</Mount>
</ScrollView>
</SafeAreaView>
</World>
);
}
SocialProfileScreen.displayName = "SocialProfileScreen";
Recreate the "Social Profile Screen" screen in React Native using LumioUI.
Goal: Profile with stats and photo grid Match the reference implementation's layout, behavior, and motion exactly — this is a production screen, not a mockup.
## Setup
Fastest path — install the screen plus its component deps:
```bash
npx lumioui add social-social-profile
```
Or pull just the components: `npx lumioui add avatar button icon image tabs text`
Native packages:
- @lumioui/ui@latest
- @lumioui/core@latest
- react-native-safe-area-context@*
- react-native-reanimated@*
- react-native-svg@*
- nativewind@*
Stack assumptions: Expo SDK 54 / RN 0.81, Reanimated 4, NativeWind v4, TypeScript strict, Expo Go compatible.
## Components — how, where, when
### `avatar` — Circular user image with fallback initials and status dot.
- `<Avatar>` ×1
### `button` — Tactile pill button with press spring, ink wash and async loading.
- `<Button>` ×5
### `icon` — Lucide icon set mapped to theme colors and sizes.
- `<Icon>` ×1
### `image` — Cached image with placeholder, fallback and aspect handling.
- `<Image>` ×1
### `tabs` — Underline tabs with gliding indicator and press ink.
- `<TabsTrigger>` ×3
- `<Tabs>` ×1
- `<TabsList>` ×1
### `text` — Themed type scale from caption to display.
- `<Text>` ×8
## Conventions (non-negotiable)
- Styling via NativeWind `className` with semantic tokens only: `bg-background`, `text-foreground`, `bg-card`, `text-card-foreground`, `bg-secondary`, `bg-muted`, `text-muted-foreground`, `bg-accent`, `bg-destructive`, `border-border`. Hard-coded colors only inside media overlays (`text-white`, `bg-black/N`).
- Motion via the token presets from `@lumioui/core` (`spring.press`, `spring.surface`, `spring.glide`, `timing.fast`, `timing.slow`, …) — no bespoke spring configs or durations.
- Gate transform motion behind `useReducedMotion()`; keep opacity/color feedback, drop travel and overshoot.
- Haptics via `useHaptic()`: `light` on press, `selection` on toggle/select, `warning` on invalid input. Never import expo-haptics directly.
- Press feedback via `usePressAnimation()` (~0.97 scale), not `activeOpacity` tricks.
- a11y: `accessibilityRole` + `accessibilityLabel` on every control, touch targets ≥44pt.
- Entrance choreography: staggered `Mount` wrappers (delay 0/60/120…) so regions land in sequence instead of popping in at once.
- Wrap the screen in `SafeAreaView`; keep dark mode working via the semantic tokens.
## Deliverable
One file: `screens/social/social-profile.tsx` exporting SocialProfileScreen. Preserve the props interface — the host app wires the callbacks (navigation, submit handlers) through them.
## Reference implementation
The LumioUI source for this screen — reproduce it faithfully:
```tsx
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Avatar, Button, Icon, Image, Tabs, TabsList, TabsTrigger, Text } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { Mount, Press, World } from "../shared";
export interface SocialProfileScreenProps {
name?: string;
handle?: string;
bio?: string;
avatarUrl?: string;
/** "1,284" posts / "12.4k" followers / "386" following */
posts?: string;
followers?: string;
following?: string;
photoUrls?: string[];
isOwn?: boolean;
onPostPress?: (index: number) => void;
onFollowers?: () => void;
onBack?: () => void;
}
const pic = (id: string) =>
`https://images.unsplash.com/photo-${id}?w=400&h=400&fit=crop&q=60&auto=format`;
const DEFAULT_PHOTOS = [
"1469334031218-e382a71b716b",
"1445205170230-053b83016050",
"1523381210434-271e8be1f52b",
"1434389677669-e08b4cac3105",
"1544441893-675973e31985",
"1441986300917-64674bd600d8",
"1585208798174-6cedd86e019a",
"1513735492246-483525079686",
"1548707309-dcebeab9ea9b",
"1569959220744-ff553533f492",
"1538332576228-eb5b4c4de6f5",
"1523531294919-4bcd7c65e216",
].map(pic);
/** Social profile — avatar + stats + bio + follow row + photo grid. */
export function SocialProfileScreen({
name = "Amara Chen",
handle = "@amara.makes",
bio = "Design systems by day, film photography by weekend",
avatarUrl = "https://i.pravatar.cc/300?img=47",
posts = "128",
followers = "12.4k",
following = "386",
photoUrls = DEFAULT_PHOTOS,
isOwn = false,
onPostPress,
onFollowers,
onBack,
}: SocialProfileScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [followingBack, setFollowingBack] = React.useState(false);
const [tab, setTab] = React.useState("posts");
return (
<World primary="#65A30D">
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
<View className="flex-row items-center gap-2 px-4 pb-1 pt-2">
<Button
variant="ghost"
size="icon"
haptic="light"
onPress={() => onBack?.()}
accessibilityLabel="Go back"
className="-ml-2 h-10 w-10"
>
<Icon name="chevron-left" size="md" color="foreground" />
</Button>
<Text variant="h3" accessibilityRole="header" numberOfLines={1}>
{handle}
</Text>
</View>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingBottom: insets.bottom + 32 }}
>
{/* Identity — avatar + stat row. */}
<Mount className="flex-row items-center gap-5 px-4 pt-2">
<Avatar
size="xl"
source={{ uri: avatarUrl }}
fallback={name}
alt={name}
/>
<View className="flex-1 flex-row justify-between pl-4">
{[
{ label: "Posts", value: posts, action: undefined },
{ label: "Followers", value: followers, action: onFollowers },
{ label: "Following", value: following, action: onFollowers },
].map((s) =>
s.action ? (
<Press
key={s.label}
haptic="light"
onPress={s.action}
accessibilityRole="button"
accessibilityLabel={`${s.value} ${s.label.toLowerCase()}`}
className="items-center"
>
<Text className="text-lg font-semibold">{s.value}</Text>
<Text className="text-xs text-muted-foreground">{s.label}</Text>
</Press>
) : (
<View key={s.label} className="items-center">
<Text className="text-lg font-semibold">{s.value}</Text>
<Text className="text-xs text-muted-foreground">{s.label}</Text>
</View>
),
)}
</View>
</Mount>
{/* Name + bio. */}
<Mount delay={60} className="gap-0.5 px-4 pt-3">
<Text className="font-semibold">{name}</Text>
<Text className="text-sm text-muted-foreground">{bio}</Text>
{/* Location + tenure — profiles anchor a person in a place. */}
<Text className="pt-0.5 text-[11px] text-muted-foreground/80">
Lisbon · on Lumio since 2021
</Text>
</Mount>
{/* Action row — follow/message for others, edit/share for own. */}
<Mount delay={120} className="mt-4 flex-row gap-2 px-4">
{isOwn ? (
<>
<Button variant="secondary" haptic="light" className="h-9 flex-1">
Edit profile
</Button>
<Button variant="secondary" haptic="light" className="h-9 flex-1">
Share profile
</Button>
</>
) : (
<>
<Button
variant={followingBack ? "secondary" : "default"}
haptic="light"
onPress={() => {
haptics.selection();
setFollowingBack((f) => !f);
}}
accessibilityLabel={followingBack ? "Following" : "Follow"}
accessibilityState={{ checked: followingBack }}
className="h-9 flex-1"
>
{followingBack ? "Following" : "Follow"}
</Button>
<Button
variant="secondary"
haptic="light"
onPress={() => haptics.light()}
accessibilityLabel="Message"
className="h-9 flex-1"
>
Message
</Button>
</>
)}
</Mount>
{/* Tabs — posts / reels / tagged like Instagram. */}
<Mount delay={180} className="px-4 pt-4">
<Tabs
value={tab}
onValueChange={(v) => {
haptics.selection();
setTab(v);
}}
variant="line"
>
<TabsList className="w-full">
<TabsTrigger value="posts" icon="grid" />
<TabsTrigger value="reels" icon="play" />
<TabsTrigger value="tagged" icon="user" />
</TabsList>
</Tabs>
</Mount>
{/* Photo grid — 3-col, the profile's content. */}
<Mount delay={240} className="mt-1 flex-row flex-wrap px-1">
{photoUrls.map((uri, i) => (
<Press
key={uri}
haptic="light"
onPress={() => onPostPress?.(i)}
accessibilityLabel={`Post ${i + 1}`}
className="w-1/3 p-1"
>
<Image
source={{ uri }}
className="aspect-square w-full rounded-2xl bg-muted"
accessibilityLabel={`Photo ${i + 1}`}
/>
</Press>
))}
</Mount>
</ScrollView>
</SafeAreaView>
</World>
);
}
SocialProfileScreen.displayName = "SocialProfileScreen";
```
Screen: https://lumioui.dev/screens/social-social-profile