Followers/following tabs with mutual-proof strip and follow actions
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Avatar, Button, Glass, Icon, SearchInput, Separator, Tabs, TabsList, TabsTrigger, Text, } from "@lumioui/ui";
import { Mount, Press, World } from "../shared";
import { useHaptic } from "@lumioui/core";
export interface Follower {
id: string;
name: string;
handle: string;
avatarUrl: string;
following?: boolean;
mutual?: boolean;
}
export interface FollowersListScreenProps {
title?: string;
followers?: Follower[];
/** The "Following" tab's list — defaults to the followers flagged
* `following` so a single dataset drives both tabs. */
following?: Follower[];
onBack?: () => void;
}
const DEFAULT_FOLLOWING: Follower[] = [
{ id: "g1", name: "Priya Nair", handle: "priya.codes", avatarUrl: "https://i.pravatar.cc/150?img=32", following: true },
{ id: "g2", name: "Sofia Marino", handle: "sofi.makes", avatarUrl: "https://i.pravatar.cc/150?img=23", following: true },
{ id: "g3", name: "Lena Kovács", handle: "lenak", avatarUrl: "https://i.pravatar.cc/150?img=45", following: true },
{ id: "g4", name: "Diego Ruiz", handle: "diegoruiz", avatarUrl: "https://i.pravatar.cc/150?img=53", following: true },
{ id: "g5", name: "Camila Ortiz", handle: "camila.frames", avatarUrl: "https://i.pravatar.cc/150?img=28", following: true },
{ id: "g6", name: "Atelier Nord", handle: "ateliernord", avatarUrl: "https://i.pravatar.cc/150?img=21", following: true },
];
const DEFAULT_FOLLOWERS: Follower[] = [
{ id: "f1", name: "Noah Reyes", handle: "noahshoots", avatarUrl: "https://i.pravatar.cc/150?img=13", mutual: true },
{ id: "f2", name: "Priya Nair", handle: "priya.codes", avatarUrl: "https://i.pravatar.cc/150?img=32", following: true },
{ id: "f3", name: "Marcus Oduya", handle: "marcus.o", avatarUrl: "https://i.pravatar.cc/150?img=59", mutual: true },
{ id: "f4", name: "Lena Kovács", handle: "lenak", avatarUrl: "https://i.pravatar.cc/150?img=45", following: true },
{ id: "f5", name: "Tariq Aziz", handle: "tariqaz", avatarUrl: "https://i.pravatar.cc/150?img=67" },
{ id: "f6", name: "Sofia Marino", handle: "sofi.makes", avatarUrl: "https://i.pravatar.cc/150?img=23", following: true },
{ id: "f7", name: "Amara Chen", handle: "amara.makes", avatarUrl: "https://i.pravatar.cc/150?img=47", mutual: true },
{ id: "f8", name: "Diego Ruiz", handle: "diegoruiz", avatarUrl: "https://i.pravatar.cc/150?img=53", following: true },
{ id: "f9", name: "Maya Chen", handle: "maya.design", avatarUrl: "https://i.pravatar.cc/150?img=44" },
{ id: "f10", name: "Jonah Wells", handle: "jonahw", avatarUrl: "https://i.pravatar.cc/150?img=68" },
{ id: "f11", name: "Camila Ortiz", handle: "camila.frames", avatarUrl: "https://i.pravatar.cc/150?img=28", following: true },
{ id: "f12", name: "Ren Ishida", handle: "ren.builds", avatarUrl: "https://i.pravatar.cc/150?img=51" },
];
/** Followers list — search + follower rows with follow/remove actions. */
export function FollowersListScreen({
title = "Followers",
followers = DEFAULT_FOLLOWERS,
following = DEFAULT_FOLLOWING,
onBack,
}: FollowersListScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [tab, setTab] = React.useState<"followers" | "following">("followers");
const [query, setQuery] = React.useState("");
const [followingSet, setFollowingSet] = React.useState<Set<string>>(
() =>
new Set(
[...followers, ...following]
.filter((f) => f.following)
.map((f) => f.id),
),
);
const list = tab === "followers" ? followers : following;
const visible = query.trim()
? list.filter(
(f) =>
f.name.toLowerCase().includes(query.toLowerCase()) ||
f.handle.toLowerCase().includes(query.toLowerCase()),
)
: list;
const toggle = (id: string) => {
haptics.selection();
setFollowingSet((s) => {
const next = new Set(s);
if (next.has(id)) next.delete(id);
else next.add(id);
return next;
});
};
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">
<Press
haptic="light"
onPress={() => onBack?.()}
accessibilityRole="button"
accessibilityLabel="Go back"
>
<Glass interactive effect="regular" className="h-10 w-10 items-center justify-center rounded-full">
<Icon name="chevron-left" size="md" color="foreground" />
</Glass>
</Press>
<Text variant="h2" accessibilityRole="header">
{title}
</Text>
{/* Mutuals line — social lists surface shared connections first. */}
<Text variant="muted" className="text-xs">
4 friends you know
</Text>
</View>
{/* Followers / Following — one page with two faces, the IG idiom. */}
<Tabs
value={tab}
onValueChange={(v) => {
haptics.selection();
setTab(v as "followers" | "following");
setQuery("");
}}
variant="line"
>
<TabsList className="w-full">
<TabsTrigger value="followers">{`Followers ${followers.length}`}</TabsTrigger>
<TabsTrigger value="following">{`Following ${following.length}`}</TabsTrigger>
</TabsList>
</Tabs>
<View className="px-4 pb-1 pt-2">
<SearchInput
glass
value={query}
onChangeText={setQuery}
placeholder={tab === "followers" ? "Search followers" : "Search following"}
accessibilityLabel={`Search ${tab}`}
/>
</View>
{/* Under the tabs each face gets its own strip — mutual proof on
Followers, IG's interaction categories on Following. */}
{tab === "followers" ? (
<View className="flex-row items-center gap-3 px-6 pb-2 pt-2">
<Text className="text-xl font-bold tracking-tight tabular-nums">
{followers.length}
</Text>
<Mount className="-mr-1 flex-row">
{followers.slice(0, 3).map((f, i) => (
<View key={f.id} className={`${i > 0 ? "-ml-2" : ""} overflow-hidden rounded-full border-2 border-background`}>
<Avatar size="sm" source={{ uri: f.avatarUrl }} fallback={f.name} alt={f.name} />
</View>
))}
</Mount>
<Text variant="small" className="flex-1 text-muted-foreground">
{followers.filter((f) => f.mutual).length} mutual
</Text>
</View>
) : (
<View className="flex-row gap-2 px-6 pb-2 pt-2">
{["Least interacted with", "Most shown in feed"].map((label) => (
<Press
key={label}
haptic="light"
accessibilityRole="button"
accessibilityLabel={label}
>
<Glass interactive effect="regular" className="rounded-full px-3 py-1.5">
<Text className="text-xs font-medium">{label}</Text>
</Glass>
</Press>
))}
</View>
)}
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingBottom: insets.bottom + 24 }}
>
{/* Full-bleed hairline rows — the IG followers idiom, not a card. */}
<Mount delay={60}>
{visible.map((f, i) => {
const isFollowing = followingSet.has(f.id);
return (
<React.Fragment key={f.id}>
{i > 0 ? <Separator className="ml-[72px]" /> : null}
<View className="flex-row items-center gap-3 px-5 py-2.5">
<Avatar size="md" source={{ uri: f.avatarUrl }} fallback={f.name} alt={f.name} />
<View className="flex-1">
<Text className="text-sm font-semibold">{f.name}</Text>
<View className="flex-row items-center gap-1.5">
<Text className="text-xs text-muted-foreground">
@{f.handle}
</Text>
{f.mutual ? (
<View className="rounded-full bg-[#EDF8C4] px-1.5 py-0.5">
<Text className="text-[10px] font-medium text-[#65A30D]">
Follows you
</Text>
</View>
) : null}
</View>
</View>
<Button
variant={isFollowing ? "secondary" : "default"}
size="sm"
haptic="light"
onPress={() => toggle(f.id)}
accessibilityLabel={isFollowing ? `Following ${f.name}` : `Follow ${f.name}`}
accessibilityState={{ checked: isFollowing }}
className="h-8 px-3"
>
{isFollowing ? "Following" : "Follow"}
</Button>
</View>
</React.Fragment>
);
})}
</Mount>
</ScrollView>
</SafeAreaView>
</World>
);
}
FollowersListScreen.displayName = "FollowersListScreen";
Recreate the "Followers List Screen" screen in React Native using LumioUI.
Goal: Followers/following tabs with mutual-proof strip and follow actions 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-followers-list
```
Or pull just the components: `npx lumioui add avatar button glass icon search-input separator 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>` ×2
### `button` — Tactile pill button with press spring, ink wash and async loading.
- `<Button>` ×1
### `glass` — iOS 26 liquid-glass surface — real glass via expo-glass-effect (Expo Go) or @callstack/liquid-glass (dev builds), SVG refraction + specular rim on web, frosted fallback elsewhere; GlassContainer melts adjacent panes into one blob
- `<Glass>` ×2
### `icon` — Lucide icon set mapped to theme colors and sizes.
- `<Icon>` ×1
### `search-input` — Search field with clear button, debounce, focus halo — plus a glass capsule mode that floats over content like iOS 26
- `<SearchInput>` ×1
### `separator` — Hairline rule with orientation and spacing control.
- `<Separator>` ×1
### `tabs` — Underline tabs with gliding indicator and press ink.
- `<TabsTrigger>` ×2
- `<Tabs>` ×1 — Followers / Following — one page with two faces, the IG idiom.
- `<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/followers-list.tsx` exporting FollowersListScreen. 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, Glass, Icon, SearchInput, Separator, Tabs, TabsList, TabsTrigger, Text, } from "@lumioui/ui";
import { Mount, Press, World } from "../shared";
import { useHaptic } from "@lumioui/core";
export interface Follower {
id: string;
name: string;
handle: string;
avatarUrl: string;
following?: boolean;
mutual?: boolean;
}
export interface FollowersListScreenProps {
title?: string;
followers?: Follower[];
/** The "Following" tab's list — defaults to the followers flagged
* `following` so a single dataset drives both tabs. */
following?: Follower[];
onBack?: () => void;
}
const DEFAULT_FOLLOWING: Follower[] = [
{ id: "g1", name: "Priya Nair", handle: "priya.codes", avatarUrl: "https://i.pravatar.cc/150?img=32", following: true },
{ id: "g2", name: "Sofia Marino", handle: "sofi.makes", avatarUrl: "https://i.pravatar.cc/150?img=23", following: true },
{ id: "g3", name: "Lena Kovács", handle: "lenak", avatarUrl: "https://i.pravatar.cc/150?img=45", following: true },
{ id: "g4", name: "Diego Ruiz", handle: "diegoruiz", avatarUrl: "https://i.pravatar.cc/150?img=53", following: true },
{ id: "g5", name: "Camila Ortiz", handle: "camila.frames", avatarUrl: "https://i.pravatar.cc/150?img=28", following: true },
{ id: "g6", name: "Atelier Nord", handle: "ateliernord", avatarUrl: "https://i.pravatar.cc/150?img=21", following: true },
];
const DEFAULT_FOLLOWERS: Follower[] = [
{ id: "f1", name: "Noah Reyes", handle: "noahshoots", avatarUrl: "https://i.pravatar.cc/150?img=13", mutual: true },
{ id: "f2", name: "Priya Nair", handle: "priya.codes", avatarUrl: "https://i.pravatar.cc/150?img=32", following: true },
{ id: "f3", name: "Marcus Oduya", handle: "marcus.o", avatarUrl: "https://i.pravatar.cc/150?img=59", mutual: true },
{ id: "f4", name: "Lena Kovács", handle: "lenak", avatarUrl: "https://i.pravatar.cc/150?img=45", following: true },
{ id: "f5", name: "Tariq Aziz", handle: "tariqaz", avatarUrl: "https://i.pravatar.cc/150?img=67" },
{ id: "f6", name: "Sofia Marino", handle: "sofi.makes", avatarUrl: "https://i.pravatar.cc/150?img=23", following: true },
{ id: "f7", name: "Amara Chen", handle: "amara.makes", avatarUrl: "https://i.pravatar.cc/150?img=47", mutual: true },
{ id: "f8", name: "Diego Ruiz", handle: "diegoruiz", avatarUrl: "https://i.pravatar.cc/150?img=53", following: true },
{ id: "f9", name: "Maya Chen", handle: "maya.design", avatarUrl: "https://i.pravatar.cc/150?img=44" },
{ id: "f10", name: "Jonah Wells", handle: "jonahw", avatarUrl: "https://i.pravatar.cc/150?img=68" },
{ id: "f11", name: "Camila Ortiz", handle: "camila.frames", avatarUrl: "https://i.pravatar.cc/150?img=28", following: true },
{ id: "f12", name: "Ren Ishida", handle: "ren.builds", avatarUrl: "https://i.pravatar.cc/150?img=51" },
];
/** Followers list — search + follower rows with follow/remove actions. */
export function FollowersListScreen({
title = "Followers",
followers = DEFAULT_FOLLOWERS,
following = DEFAULT_FOLLOWING,
onBack,
}: FollowersListScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [tab, setTab] = React.useState<"followers" | "following">("followers");
const [query, setQuery] = React.useState("");
const [followingSet, setFollowingSet] = React.useState<Set<string>>(
() =>
new Set(
[...followers, ...following]
.filter((f) => f.following)
.map((f) => f.id),
),
);
const list = tab === "followers" ? followers : following;
const visible = query.trim()
? list.filter(
(f) =>
f.name.toLowerCase().includes(query.toLowerCase()) ||
f.handle.toLowerCase().includes(query.toLowerCase()),
)
: list;
const toggle = (id: string) => {
haptics.selection();
setFollowingSet((s) => {
const next = new Set(s);
if (next.has(id)) next.delete(id);
else next.add(id);
return next;
});
};
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">
<Press
haptic="light"
onPress={() => onBack?.()}
accessibilityRole="button"
accessibilityLabel="Go back"
>
<Glass interactive effect="regular" className="h-10 w-10 items-center justify-center rounded-full">
<Icon name="chevron-left" size="md" color="foreground" />
</Glass>
</Press>
<Text variant="h2" accessibilityRole="header">
{title}
</Text>
{/* Mutuals line — social lists surface shared connections first. */}
<Text variant="muted" className="text-xs">
4 friends you know
</Text>
</View>
{/* Followers / Following — one page with two faces, the IG idiom. */}
<Tabs
value={tab}
onValueChange={(v) => {
haptics.selection();
setTab(v as "followers" | "following");
setQuery("");
}}
variant="line"
>
<TabsList className="w-full">
<TabsTrigger value="followers">{`Followers ${followers.length}`}</TabsTrigger>
<TabsTrigger value="following">{`Following ${following.length}`}</TabsTrigger>
</TabsList>
</Tabs>
<View className="px-4 pb-1 pt-2">
<SearchInput
glass
value={query}
onChangeText={setQuery}
placeholder={tab === "followers" ? "Search followers" : "Search following"}
accessibilityLabel={`Search ${tab}`}
/>
</View>
{/* Under the tabs each face gets its own strip — mutual proof on
Followers, IG's interaction categories on Following. */}
{tab === "followers" ? (
<View className="flex-row items-center gap-3 px-6 pb-2 pt-2">
<Text className="text-xl font-bold tracking-tight tabular-nums">
{followers.length}
</Text>
<Mount className="-mr-1 flex-row">
{followers.slice(0, 3).map((f, i) => (
<View key={f.id} className={`${i > 0 ? "-ml-2" : ""} overflow-hidden rounded-full border-2 border-background`}>
<Avatar size="sm" source={{ uri: f.avatarUrl }} fallback={f.name} alt={f.name} />
</View>
))}
</Mount>
<Text variant="small" className="flex-1 text-muted-foreground">
{followers.filter((f) => f.mutual).length} mutual
</Text>
</View>
) : (
<View className="flex-row gap-2 px-6 pb-2 pt-2">
{["Least interacted with", "Most shown in feed"].map((label) => (
<Press
key={label}
haptic="light"
accessibilityRole="button"
accessibilityLabel={label}
>
<Glass interactive effect="regular" className="rounded-full px-3 py-1.5">
<Text className="text-xs font-medium">{label}</Text>
</Glass>
</Press>
))}
</View>
)}
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingBottom: insets.bottom + 24 }}
>
{/* Full-bleed hairline rows — the IG followers idiom, not a card. */}
<Mount delay={60}>
{visible.map((f, i) => {
const isFollowing = followingSet.has(f.id);
return (
<React.Fragment key={f.id}>
{i > 0 ? <Separator className="ml-[72px]" /> : null}
<View className="flex-row items-center gap-3 px-5 py-2.5">
<Avatar size="md" source={{ uri: f.avatarUrl }} fallback={f.name} alt={f.name} />
<View className="flex-1">
<Text className="text-sm font-semibold">{f.name}</Text>
<View className="flex-row items-center gap-1.5">
<Text className="text-xs text-muted-foreground">
@{f.handle}
</Text>
{f.mutual ? (
<View className="rounded-full bg-[#EDF8C4] px-1.5 py-0.5">
<Text className="text-[10px] font-medium text-[#65A30D]">
Follows you
</Text>
</View>
) : null}
</View>
</View>
<Button
variant={isFollowing ? "secondary" : "default"}
size="sm"
haptic="light"
onPress={() => toggle(f.id)}
accessibilityLabel={isFollowing ? `Following ${f.name}` : `Follow ${f.name}`}
accessibilityState={{ checked: isFollowing }}
className="h-8 px-3"
>
{isFollowing ? "Following" : "Follow"}
</Button>
</View>
</React.Fragment>
);
})}
</Mount>
</ScrollView>
</SafeAreaView>
</World>
);
}
FollowersListScreen.displayName = "FollowersListScreen";
```
Screen: https://lumioui.dev/screens/social-followers-list