Blocked-user list with inline unblock actions and empty state.
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Avatar, Button, EmptyState, Glass, Icon, Text, } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { Mount } from "../shared";
export interface BlockedAccount {
id: string;
name: string;
handle: string;
avatarUrl?: string;
blockedAt: string;
}
export interface BlockedAccountsScreenProps {
accounts?: BlockedAccount[];
onUnblock?: (id: string) => void;
onBack?: () => void;
}
const face = (n: number) => `https://i.pravatar.cc/150?img=${n}`;
const DEFAULT_ACCOUNTS: BlockedAccount[] = [
{ id: "b1", name: "Jordan Blake", handle: "@jblake", avatarUrl: face(12), blockedAt: "Blocked Aug 2" },
{ id: "b2", name: "Priya Nair", handle: "@priyan", avatarUrl: face(32), blockedAt: "Blocked Jul 14" },
{ id: "b3", name: "Tom Reiner", handle: "@treiner", avatarUrl: face(53), blockedAt: "Blocked May 30" },
{ id: "b4", name: "Mira Castellanos", handle: "@mirac", avatarUrl: face(45), blockedAt: "Blocked Apr 18" },
{ id: "b5", name: "Leo Vargas", handle: "@leov", avatarUrl: face(68), blockedAt: "Blocked Feb 2" },
];
/** Blocked accounts — list of blocked users with inline unblock action. */
export function BlockedAccountsScreen({
accounts = DEFAULT_ACCOUNTS,
onUnblock,
onBack,
}: BlockedAccountsScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [blocked, setBlocked] = React.useState(accounts);
React.useEffect(() => setBlocked(accounts), [accounts]);
const unblock = (id: string) => () => {
haptics.medium();
setBlocked((prev) => prev.filter((a) => a.id !== id));
onUnblock?.(id);
};
return (
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
{/* Floating chrome — back pill + hug-label title pill + block pill. */}
<View className="absolute inset-x-4 z-10" style={{ top: insets.top + 8 }} pointerEvents="box-none">
<View className="flex-row items-center justify-between gap-2">
<Glass
effect="regular"
className="h-11 w-11 items-center justify-center rounded-full"
>
<Button
variant="ghost"
size="icon"
haptic="light"
onPress={() => onBack?.()}
accessibilityLabel="Go back"
className="h-9 w-9"
>
<Icon name="chevron-left" size="md" color="foreground" />
</Button>
</Glass>
<Glass
effect="regular"
className="h-11 w-11 items-center justify-center rounded-full"
>
<Button
variant="ghost"
size="icon"
haptic="light"
onPress={() => haptics.light()}
accessibilityLabel="Block account"
className="h-9 w-9"
>
<Icon name="plus" size="md" color="foreground" />
</Button>
</Glass>
</View>
<View pointerEvents="none" className="absolute inset-0 items-center justify-center">
<Glass
effect="regular"
className="h-11 flex-row items-center justify-center rounded-full px-5"
>
<Text accessibilityRole="header" className="text-sm font-bold tracking-tight">
Blocked
</Text>
</Glass>
</View>
</View>
{blocked.length === 0 ? (
<Mount className="flex-1 items-center justify-center px-8">
<EmptyState
title="No blocked accounts"
description="People you block won't be able to message or follow you."
/>
</Mount>
) : (
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingTop: insets.top + 60, paddingBottom: insets.bottom + 32 }}
contentContainerClassName="px-6"
>
{/* Count line — the number is the content on this screen. */}
<Text variant="muted" className="px-2 pb-1 text-sm">
{blocked.length} {blocked.length === 1 ? "person" : "people"} blocked
</Text>
{/* Muted person cards — blocked accounts dim (avatar + name at
55%) until unblocked, so the screen reads its own state. */}
<View className="gap-3 pt-2">
{blocked.map((account) => (
<View
key={account.id}
className="flex-row items-center gap-3 overflow-hidden rounded-2xl p-4"
>
<Glass interactive effect="clear" sheen={0.5} className="absolute inset-0 rounded-2xl" pointerEvents="none" />
<View className="opacity-60">
<Avatar
size="md"
source={account.avatarUrl ? { uri: account.avatarUrl } : undefined}
fallback={account.name}
alt={account.name}
/>
</View>
<View className="flex-1">
<Text className="font-medium text-muted-foreground line-through decoration-muted-foreground/40">
{account.name}
</Text>
<Text variant="small" className="text-muted-foreground">
{account.handle} · {account.blockedAt}
</Text>
</View>
<Button
variant="secondary"
size="sm"
haptic="medium"
onPress={unblock(account.id)}
accessibilityLabel={`Unblock ${account.name}`}
>
Unblock
</Button>
</View>
))}
</View>
<Text variant="small" className="px-2 pt-4 text-muted-foreground">
Blocked people can't see your posts, message you, or find your profile in search.
</Text>
{/* Silence guarantee — blocking never notifies the other side. */}
<View className="mt-3 flex-row items-start gap-2.5 overflow-hidden rounded-2xl px-4 py-3">
<Glass interactive effect="clear" sheen={0.4} className="absolute inset-0 rounded-2xl" pointerEvents="none" />
<Icon name="eye-off" size="sm" color="mutedForeground" />
<Text variant="muted" className="flex-1 text-xs leading-4">
They aren't notified — and if you unblock, nothing is sent
either.
</Text>
</View>
</ScrollView>
)}
</SafeAreaView>
);
}
BlockedAccountsScreen.displayName = "BlockedAccountsScreen";
Recreate the "Blocked accounts Screen" screen in React Native using LumioUI.
Goal: Blocked-user list with inline unblock actions and empty state. 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 core-blocked-accounts
```
Or pull just the components: `npx lumioui add avatar button empty-state icon list 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>` ×3
### `empty-state` — Illustrated placeholder with title, copy and action slot.
- `<EmptyState>` ×1
### `icon` — Lucide icon set mapped to theme colors and sizes.
- `<Icon>` ×3
### `list` — Settings-style rows with separators and press feedback.
- imported but not rendered directly — likely used through a sibling or as a utility
### `text` — Themed type scale from caption to display.
- `<Text>` ×6
## 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/core/blocked-accounts.tsx` exporting BlockedAccountsScreen. 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, EmptyState, Glass, Icon, Text, } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { Mount } from "../shared";
export interface BlockedAccount {
id: string;
name: string;
handle: string;
avatarUrl?: string;
blockedAt: string;
}
export interface BlockedAccountsScreenProps {
accounts?: BlockedAccount[];
onUnblock?: (id: string) => void;
onBack?: () => void;
}
const face = (n: number) => `https://i.pravatar.cc/150?img=${n}`;
const DEFAULT_ACCOUNTS: BlockedAccount[] = [
{ id: "b1", name: "Jordan Blake", handle: "@jblake", avatarUrl: face(12), blockedAt: "Blocked Aug 2" },
{ id: "b2", name: "Priya Nair", handle: "@priyan", avatarUrl: face(32), blockedAt: "Blocked Jul 14" },
{ id: "b3", name: "Tom Reiner", handle: "@treiner", avatarUrl: face(53), blockedAt: "Blocked May 30" },
{ id: "b4", name: "Mira Castellanos", handle: "@mirac", avatarUrl: face(45), blockedAt: "Blocked Apr 18" },
{ id: "b5", name: "Leo Vargas", handle: "@leov", avatarUrl: face(68), blockedAt: "Blocked Feb 2" },
];
/** Blocked accounts — list of blocked users with inline unblock action. */
export function BlockedAccountsScreen({
accounts = DEFAULT_ACCOUNTS,
onUnblock,
onBack,
}: BlockedAccountsScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [blocked, setBlocked] = React.useState(accounts);
React.useEffect(() => setBlocked(accounts), [accounts]);
const unblock = (id: string) => () => {
haptics.medium();
setBlocked((prev) => prev.filter((a) => a.id !== id));
onUnblock?.(id);
};
return (
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
{/* Floating chrome — back pill + hug-label title pill + block pill. */}
<View className="absolute inset-x-4 z-10" style={{ top: insets.top + 8 }} pointerEvents="box-none">
<View className="flex-row items-center justify-between gap-2">
<Glass
effect="regular"
className="h-11 w-11 items-center justify-center rounded-full"
>
<Button
variant="ghost"
size="icon"
haptic="light"
onPress={() => onBack?.()}
accessibilityLabel="Go back"
className="h-9 w-9"
>
<Icon name="chevron-left" size="md" color="foreground" />
</Button>
</Glass>
<Glass
effect="regular"
className="h-11 w-11 items-center justify-center rounded-full"
>
<Button
variant="ghost"
size="icon"
haptic="light"
onPress={() => haptics.light()}
accessibilityLabel="Block account"
className="h-9 w-9"
>
<Icon name="plus" size="md" color="foreground" />
</Button>
</Glass>
</View>
<View pointerEvents="none" className="absolute inset-0 items-center justify-center">
<Glass
effect="regular"
className="h-11 flex-row items-center justify-center rounded-full px-5"
>
<Text accessibilityRole="header" className="text-sm font-bold tracking-tight">
Blocked
</Text>
</Glass>
</View>
</View>
{blocked.length === 0 ? (
<Mount className="flex-1 items-center justify-center px-8">
<EmptyState
title="No blocked accounts"
description="People you block won't be able to message or follow you."
/>
</Mount>
) : (
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingTop: insets.top + 60, paddingBottom: insets.bottom + 32 }}
contentContainerClassName="px-6"
>
{/* Count line — the number is the content on this screen. */}
<Text variant="muted" className="px-2 pb-1 text-sm">
{blocked.length} {blocked.length === 1 ? "person" : "people"} blocked
</Text>
{/* Muted person cards — blocked accounts dim (avatar + name at
55%) until unblocked, so the screen reads its own state. */}
<View className="gap-3 pt-2">
{blocked.map((account) => (
<View
key={account.id}
className="flex-row items-center gap-3 overflow-hidden rounded-2xl p-4"
>
<Glass interactive effect="clear" sheen={0.5} className="absolute inset-0 rounded-2xl" pointerEvents="none" />
<View className="opacity-60">
<Avatar
size="md"
source={account.avatarUrl ? { uri: account.avatarUrl } : undefined}
fallback={account.name}
alt={account.name}
/>
</View>
<View className="flex-1">
<Text className="font-medium text-muted-foreground line-through decoration-muted-foreground/40">
{account.name}
</Text>
<Text variant="small" className="text-muted-foreground">
{account.handle} · {account.blockedAt}
</Text>
</View>
<Button
variant="secondary"
size="sm"
haptic="medium"
onPress={unblock(account.id)}
accessibilityLabel={`Unblock ${account.name}`}
>
Unblock
</Button>
</View>
))}
</View>
<Text variant="small" className="px-2 pt-4 text-muted-foreground">
Blocked people can't see your posts, message you, or find your profile in search.
</Text>
{/* Silence guarantee — blocking never notifies the other side. */}
<View className="mt-3 flex-row items-start gap-2.5 overflow-hidden rounded-2xl px-4 py-3">
<Glass interactive effect="clear" sheen={0.4} className="absolute inset-0 rounded-2xl" pointerEvents="none" />
<Icon name="eye-off" size="sm" color="mutedForeground" />
<Text variant="muted" className="flex-1 text-xs leading-4">
They aren't notified — and if you unblock, nothing is sent
either.
</Text>
</View>
</ScrollView>
)}
</SafeAreaView>
);
}
BlockedAccountsScreen.displayName = "BlockedAccountsScreen";
```
Screen: https://lumioui.dev/screens/core-blocked-accounts