Visibility and data-sharing toggles with links to blocked accounts and export.
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Glass, Icon, List, ProgressRing, Switch, Text, type IconName } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { Mount, BLOCK_STAGGER, Press, RowIcon, SEPARATOR_INSET, type IconTone } from "../shared";
export interface PrivacyRow {
key: string;
title: string;
subtitle?: string;
icon: IconName;
tone: IconTone;
}
export interface PermissionRow {
key: string;
title: string;
status: string;
icon: IconName;
tone: IconTone;
}
export interface PrivacySettingsScreenProps {
/** Toggle rows grouped by section. */
toggles?: { title: string; items: PrivacyRow[] }[];
/** Per-permission access rows (camera, mic, …) with their current status. */
permissions?: PermissionRow[];
values?: Record<string, boolean>;
onToggle?: (key: string, value: boolean) => void;
onNavigate?: (route: string) => void;
onBack?: () => void;
}
const DEFAULT_TOGGLES: NonNullable<PrivacySettingsScreenProps["toggles"]> = [
{
title: "Visibility",
items: [
{ key: "privateAccount", title: "Private account", subtitle: "Only approved followers see your posts", icon: "lock", tone: "blue" },
{ key: "activityStatus", title: "Activity status", subtitle: "Show when you're active", icon: "eye", tone: "green" },
{ key: "readReceipts", title: "Read receipts", subtitle: "Let senders know you've seen messages", icon: "check", tone: "teal" },
],
},
{
title: "Data",
items: [
{ key: "personalizedAds", title: "Personalized ads", subtitle: "Ads based on your activity", icon: "tag", tone: "orange" },
{ key: "analytics", title: "Usage analytics", subtitle: "Help improve Lumio", icon: "share", tone: "gray" },
],
},
];
const DEFAULT_PERMISSIONS: PermissionRow[] = [
{ key: "camera", title: "Camera", status: "Allowed", icon: "camera", tone: "blue" },
{ key: "microphone", title: "Microphone", status: "Allowed", icon: "mic", tone: "orange" },
{ key: "photos", title: "Photos", status: "Selected photos", icon: "image", tone: "purple" },
{ key: "location", title: "Location", status: "While using", icon: "map-pin", tone: "green" },
];
const DEFAULT_VALUES: Record<string, boolean> = {
privateAccount: false,
activityStatus: true,
readReceipts: true,
personalizedAds: false,
analytics: true,
};
/** Privacy settings — visibility toggles, permission access, management links. */
export function PrivacySettingsScreen({
toggles = DEFAULT_TOGGLES,
permissions = DEFAULT_PERMISSIONS,
values = DEFAULT_VALUES,
onToggle,
onNavigate,
onBack,
}: PrivacySettingsScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [local, setLocal] = React.useState(values);
const toggle = (key: string, v: boolean) => {
haptics.selection();
setLocal((prev) => ({ ...prev, [key]: v }));
onToggle?.(key, v);
};
return (
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
{/* Floating chrome — back disc + centered title pill. */}
<View className="absolute inset-x-4 z-10" style={{ top: insets.top + 8 }} pointerEvents="box-none">
<View className="flex-row items-center gap-2">
<Glass
effect="regular"
className="h-11 w-11 items-center justify-center rounded-full"
>
<Press
onPress={() => {
haptics.light();
onBack?.();
}}
accessibilityLabel="Go back"
accessibilityRole="button"
className="h-9 w-9 items-center justify-center"
>
<Icon name="chevron-left" size="md" color="foreground" />
</Press>
</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">
Privacy
</Text>
</Glass>
</View>
</View>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingTop: insets.top + 60, paddingBottom: insets.bottom + 32 }}
>
{/* Protection status — the shield moment other settings screens
don't have; summarizes enabled toggles so the number is real. */}
<Mount delay={BLOCK_STAGGER}>
<View className="mx-4 mb-2 mt-2 flex-row items-center gap-3 overflow-hidden rounded-3xl bg-white px-4 py-3.5 dark:bg-[#1A1A20]">
<View className="h-11 w-11 items-center justify-center rounded-full bg-[#EDF8C4] dark:bg-[#1E2410]">
<Icon name="shield" size="md" color="#65A30D" />
</View>
<View className="flex-1">
<Text className="font-semibold">
{Object.values(local).filter(Boolean).length} of {Object.keys(local).length} protections on
</Text>
<Text variant="muted" className="text-xs">
Reviewed 2 days ago
</Text>
</View>
<View accessibilityLabel={`${Object.values(local).filter(Boolean).length} of ${Object.keys(local).length} protections on`}>
<ProgressRing
value={(Object.values(local).filter(Boolean).length / Math.max(1, Object.keys(local).length)) * 100}
size={44}
strokeWidth={4}
color="success"
label={`${Object.values(local).filter(Boolean).length} of ${Object.keys(local).length} protections on`}
>
<Text className="text-xs font-bold text-success">
{Object.values(local).filter(Boolean).length}/{Object.keys(local).length}
</Text>
</ProgressRing>
</View>
</View>
</Mount>
<List inset>
{toggles.map((section, si) => (
<Mount key={section.title} delay={BLOCK_STAGGER * (si + 2)}>
<List.Section title={section.title}>
{section.items.map((item, ii) => {
const checked = local[item.key] ?? false;
return (
<React.Fragment key={item.key}>
{ii > 0 && <List.Separator className={SEPARATOR_INSET} />}
<List.Item
title={item.title}
subtitle={item.subtitle}
leading={<RowIcon name={item.icon} tone={item.tone} />}
haptic={false}
onPress={() => toggle(item.key, !checked)}
accessibilityState={{ checked }}
trailing={
<Switch
checked={checked}
onCheckedChange={(v) => toggle(item.key, v)}
accessibilityLabel={item.title}
/>
}
/>
</React.Fragment>
);
})}
</List.Section>
</Mount>
))}
<Mount delay={BLOCK_STAGGER * (toggles.length + 1)}>
<List.Section title="Permissions">
{permissions.map((perm, pi) => (
<React.Fragment key={perm.key}>
{pi > 0 && <List.Separator className={SEPARATOR_INSET} />}
<List.Item
title={perm.title}
leading={<RowIcon name={perm.icon} tone={perm.tone} />}
trailing={
<View className="flex-row items-center gap-1">
<Text variant="small" className="text-muted-foreground">
{perm.status}
</Text>
<Icon name="chevron-right" size="sm" color="mutedForeground" />
</View>
}
haptic="light"
onPress={() => onNavigate?.(`permissions/${perm.key}`)}
/>
</React.Fragment>
))}
</List.Section>
</Mount>
<Mount delay={BLOCK_STAGGER * (toggles.length + 2)}>
<List.Section title="Manage">
<List.Item
title="Blocked accounts"
subtitle="5 people"
leading={<RowIcon name="user" tone="red" />}
showChevron
haptic="light"
onPress={() => onNavigate?.("blocked")}
/>
<List.Separator className={SEPARATOR_INSET} />
<List.Item
title="Download your data"
leading={<RowIcon name="download" tone="gray" />}
showChevron
haptic="light"
onPress={() => onNavigate?.("data-export")}
/>
</List.Section>
</Mount>
</List>
{/* Permission trail — which system permissions the toggles rely on. */}
<View className="mx-4 mt-3 flex-row items-center gap-2 overflow-hidden rounded-2xl bg-white px-4 py-3 dark:bg-[#1A1A20]">
<Icon name="settings" size="sm" color="mutedForeground" />
<Text variant="muted" className="flex-1 text-xs">
3 of 7 system permissions granted — manage in device Settings
</Text>
<Icon name="chevron-right" size="sm" color="mutedForeground" />
</View>
</ScrollView>
</SafeAreaView>
);
}
PrivacySettingsScreen.displayName = "PrivacySettingsScreen";
Recreate the "Privacy Screen" screen in React Native using LumioUI.
Goal: Visibility and data-sharing toggles with links to blocked accounts and export. 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-privacy-settings
```
Or pull just the components: `npx lumioui add button icon list progress-ring switch 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
### `button` — Tactile pill button with press spring, ink wash and async loading.
- imported but not rendered directly — likely used through a sibling or as a utility
### `icon` — Lucide icon set mapped to theme colors and sizes.
- `<Icon>` ×5
### `list` — Settings-style rows with separators and press feedback.
- `<List>` ×1
### `progress-ring` — Circular progress ring with animated stroke arc, center slot and indeterminate spin.
- `<ProgressRing>` ×1
### `switch` — iOS-size toggle with spring thumb and haptics.
- `<Switch>` ×1
### `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/privacy-settings.tsx` exporting PrivacySettingsScreen. 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 { Glass, Icon, List, ProgressRing, Switch, Text, type IconName } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { Mount, BLOCK_STAGGER, Press, RowIcon, SEPARATOR_INSET, type IconTone } from "../shared";
export interface PrivacyRow {
key: string;
title: string;
subtitle?: string;
icon: IconName;
tone: IconTone;
}
export interface PermissionRow {
key: string;
title: string;
status: string;
icon: IconName;
tone: IconTone;
}
export interface PrivacySettingsScreenProps {
/** Toggle rows grouped by section. */
toggles?: { title: string; items: PrivacyRow[] }[];
/** Per-permission access rows (camera, mic, …) with their current status. */
permissions?: PermissionRow[];
values?: Record<string, boolean>;
onToggle?: (key: string, value: boolean) => void;
onNavigate?: (route: string) => void;
onBack?: () => void;
}
const DEFAULT_TOGGLES: NonNullable<PrivacySettingsScreenProps["toggles"]> = [
{
title: "Visibility",
items: [
{ key: "privateAccount", title: "Private account", subtitle: "Only approved followers see your posts", icon: "lock", tone: "blue" },
{ key: "activityStatus", title: "Activity status", subtitle: "Show when you're active", icon: "eye", tone: "green" },
{ key: "readReceipts", title: "Read receipts", subtitle: "Let senders know you've seen messages", icon: "check", tone: "teal" },
],
},
{
title: "Data",
items: [
{ key: "personalizedAds", title: "Personalized ads", subtitle: "Ads based on your activity", icon: "tag", tone: "orange" },
{ key: "analytics", title: "Usage analytics", subtitle: "Help improve Lumio", icon: "share", tone: "gray" },
],
},
];
const DEFAULT_PERMISSIONS: PermissionRow[] = [
{ key: "camera", title: "Camera", status: "Allowed", icon: "camera", tone: "blue" },
{ key: "microphone", title: "Microphone", status: "Allowed", icon: "mic", tone: "orange" },
{ key: "photos", title: "Photos", status: "Selected photos", icon: "image", tone: "purple" },
{ key: "location", title: "Location", status: "While using", icon: "map-pin", tone: "green" },
];
const DEFAULT_VALUES: Record<string, boolean> = {
privateAccount: false,
activityStatus: true,
readReceipts: true,
personalizedAds: false,
analytics: true,
};
/** Privacy settings — visibility toggles, permission access, management links. */
export function PrivacySettingsScreen({
toggles = DEFAULT_TOGGLES,
permissions = DEFAULT_PERMISSIONS,
values = DEFAULT_VALUES,
onToggle,
onNavigate,
onBack,
}: PrivacySettingsScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [local, setLocal] = React.useState(values);
const toggle = (key: string, v: boolean) => {
haptics.selection();
setLocal((prev) => ({ ...prev, [key]: v }));
onToggle?.(key, v);
};
return (
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
{/* Floating chrome — back disc + centered title pill. */}
<View className="absolute inset-x-4 z-10" style={{ top: insets.top + 8 }} pointerEvents="box-none">
<View className="flex-row items-center gap-2">
<Glass
effect="regular"
className="h-11 w-11 items-center justify-center rounded-full"
>
<Press
onPress={() => {
haptics.light();
onBack?.();
}}
accessibilityLabel="Go back"
accessibilityRole="button"
className="h-9 w-9 items-center justify-center"
>
<Icon name="chevron-left" size="md" color="foreground" />
</Press>
</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">
Privacy
</Text>
</Glass>
</View>
</View>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingTop: insets.top + 60, paddingBottom: insets.bottom + 32 }}
>
{/* Protection status — the shield moment other settings screens
don't have; summarizes enabled toggles so the number is real. */}
<Mount delay={BLOCK_STAGGER}>
<View className="mx-4 mb-2 mt-2 flex-row items-center gap-3 overflow-hidden rounded-3xl bg-white px-4 py-3.5 dark:bg-[#1A1A20]">
<View className="h-11 w-11 items-center justify-center rounded-full bg-[#EDF8C4] dark:bg-[#1E2410]">
<Icon name="shield" size="md" color="#65A30D" />
</View>
<View className="flex-1">
<Text className="font-semibold">
{Object.values(local).filter(Boolean).length} of {Object.keys(local).length} protections on
</Text>
<Text variant="muted" className="text-xs">
Reviewed 2 days ago
</Text>
</View>
<View accessibilityLabel={`${Object.values(local).filter(Boolean).length} of ${Object.keys(local).length} protections on`}>
<ProgressRing
value={(Object.values(local).filter(Boolean).length / Math.max(1, Object.keys(local).length)) * 100}
size={44}
strokeWidth={4}
color="success"
label={`${Object.values(local).filter(Boolean).length} of ${Object.keys(local).length} protections on`}
>
<Text className="text-xs font-bold text-success">
{Object.values(local).filter(Boolean).length}/{Object.keys(local).length}
</Text>
</ProgressRing>
</View>
</View>
</Mount>
<List inset>
{toggles.map((section, si) => (
<Mount key={section.title} delay={BLOCK_STAGGER * (si + 2)}>
<List.Section title={section.title}>
{section.items.map((item, ii) => {
const checked = local[item.key] ?? false;
return (
<React.Fragment key={item.key}>
{ii > 0 && <List.Separator className={SEPARATOR_INSET} />}
<List.Item
title={item.title}
subtitle={item.subtitle}
leading={<RowIcon name={item.icon} tone={item.tone} />}
haptic={false}
onPress={() => toggle(item.key, !checked)}
accessibilityState={{ checked }}
trailing={
<Switch
checked={checked}
onCheckedChange={(v) => toggle(item.key, v)}
accessibilityLabel={item.title}
/>
}
/>
</React.Fragment>
);
})}
</List.Section>
</Mount>
))}
<Mount delay={BLOCK_STAGGER * (toggles.length + 1)}>
<List.Section title="Permissions">
{permissions.map((perm, pi) => (
<React.Fragment key={perm.key}>
{pi > 0 && <List.Separator className={SEPARATOR_INSET} />}
<List.Item
title={perm.title}
leading={<RowIcon name={perm.icon} tone={perm.tone} />}
trailing={
<View className="flex-row items-center gap-1">
<Text variant="small" className="text-muted-foreground">
{perm.status}
</Text>
<Icon name="chevron-right" size="sm" color="mutedForeground" />
</View>
}
haptic="light"
onPress={() => onNavigate?.(`permissions/${perm.key}`)}
/>
</React.Fragment>
))}
</List.Section>
</Mount>
<Mount delay={BLOCK_STAGGER * (toggles.length + 2)}>
<List.Section title="Manage">
<List.Item
title="Blocked accounts"
subtitle="5 people"
leading={<RowIcon name="user" tone="red" />}
showChevron
haptic="light"
onPress={() => onNavigate?.("blocked")}
/>
<List.Separator className={SEPARATOR_INSET} />
<List.Item
title="Download your data"
leading={<RowIcon name="download" tone="gray" />}
showChevron
haptic="light"
onPress={() => onNavigate?.("data-export")}
/>
</List.Section>
</Mount>
</List>
{/* Permission trail — which system permissions the toggles rely on. */}
<View className="mx-4 mt-3 flex-row items-center gap-2 overflow-hidden rounded-2xl bg-white px-4 py-3 dark:bg-[#1A1A20]">
<Icon name="settings" size="sm" color="mutedForeground" />
<Text variant="muted" className="flex-1 text-xs">
3 of 7 system permissions granted — manage in device Settings
</Text>
<Icon name="chevron-right" size="sm" color="mutedForeground" />
</View>
</ScrollView>
</SafeAreaView>
);
}
PrivacySettingsScreen.displayName = "PrivacySettingsScreen";
```
Screen: https://lumioui.dev/screens/core-privacy-settings