Category picker for a downloadable data archive with export history and progress.
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Button, Glass, Icon, Progress, Text, } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { cn } from "@lumioui/core";
import { Mount, Press, RowIcon, StickyBottomBar } from "../shared";
export interface ExportCategory {
id: string;
label: string;
detail: string;
icon: React.ComponentProps<typeof RowIcon>["name"];
tone: React.ComponentProps<typeof RowIcon>["tone"];
}
export interface PreviousExport {
id: string;
/** e.g. "September export" */
label: string;
/** e.g. "1.9 GB · link expires Oct 2" */
detail: string;
/** When true the row offers a Download action; expired links show a
* quiet "Expired" state instead. */
active?: boolean;
}
export interface DataExportScreenProps {
categories?: ExportCategory[];
/** Earlier archives — the Takeout-style history under the builder. */
previousExports?: PreviousExport[];
onDownloadExport?: (id: string) => void;
/** Estimated archive size shown to the user. */
estimatedSize?: string;
/** Time the export stays available for download. */
expiryNote?: string;
onRequestExport?: (ids: string[]) => void;
onBack?: () => void;
}
const DEFAULT_PREVIOUS: PreviousExport[] = [
{ id: "e1", label: "September export", detail: "1.9 GB · link expires Oct 2", active: true },
{ id: "e2", label: "June export", detail: "1.4 GB · link expired", active: false },
];
const DEFAULT_CATEGORIES: ExportCategory[] = [
{ id: "profile", label: "Profile & settings", detail: "Account info, preferences", icon: "user", tone: "blue" },
{ id: "posts", label: "Posts & comments", detail: "Everything you've published", icon: "message-circle", tone: "green" },
{ id: "media", label: "Photos & videos", detail: "Original quality, in folders", icon: "image", tone: "purple" },
{ id: "activity", label: "Activity log", detail: "Sign-ins and security events", icon: "clock", tone: "orange" },
];
/** Data export — pick categories, request an archive, see progress. */
export function DataExportScreen({
categories = DEFAULT_CATEGORIES,
previousExports = DEFAULT_PREVIOUS,
onDownloadExport,
estimatedSize = "~2.1 GB",
expiryNote = "The download link stays live for 7 days.",
onRequestExport,
onBack,
}: DataExportScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [selected, setSelected] = React.useState<string[]>(
categories.map((c) => c.id)
);
const [requesting, setRequesting] = React.useState(false);
const toggle = (id: string) => () => {
haptics.selection();
setSelected((prev) =>
prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]
);
};
return (
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
{/* Floating chrome — back pill + hug-label 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"
>
<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>
</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">
Export data
</Text>
</Glass>
</View>
</View>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingTop: insets.top + 60, paddingBottom: insets.bottom + 120 }}
>
<Mount className="px-6 pb-4 pt-2">
<Text variant="small" className="text-muted-foreground">
We'll bundle everything into a single archive and email you a
download link — usually within a few hours.
</Text>
</Mount>
{/* Archive builder — selectable category tiles in a 2-col grid
rather than a checklist; the estimate sits above the CTA. */}
<Mount delay={60} className="px-6">
<Text
variant="small"
className="pb-3 font-medium uppercase tracking-widest text-muted-foreground"
accessibilityRole="header"
>
Include
</Text>
<View className="flex-row flex-wrap gap-3">
{categories.map((c) => {
const checked = selected.includes(c.id);
return (
<Press
key={c.id}
haptic="light"
pressedScale={0.97}
onPress={toggle(c.id)}
accessibilityRole="checkbox"
accessibilityState={{ checked }}
accessibilityLabel={c.label}
className="w-[48%]"
>
<Glass interactive
effect="regular"
className={cn(
"gap-2 rounded-2xl border-2 p-4",
checked ? "border-[#BEF04C]" : "border-transparent"
)}
>
<View className="flex-row items-start justify-between">
<RowIcon name={c.icon} tone={c.tone} />
<View
className={cn(
"h-5 w-5 items-center justify-center rounded-full border",
checked ? "border-[#BEF04C] bg-[#BEF04C]" : "border-border"
)}
>
{checked && <Icon name="check" size="sm" color="#1B1B26" />}
</View>
</View>
<View>
<Text className={cn("text-sm font-semibold", !checked && "text-muted-foreground")}>
{c.label}
</Text>
<Text variant="muted" className="text-xs">
{c.detail}
</Text>
</View>
</Glass>
</Press>
);
})}
</View>
</Mount>
<Mount delay={120} className="gap-1 px-8 pt-4">
<Text variant="small" className="text-muted-foreground">
Estimated size {estimatedSize} · {expiryNote}
</Text>
</Mount>
{/* Destination — where the link lands, stated once so the CTA
doesn't leave the user guessing. */}
<Mount delay={120} className="px-6 pt-4">
<View className="flex-row items-center gap-2">
<Icon name="mail" size="sm" color="mutedForeground" />
<Text variant="muted" className="text-xs">
Download link goes to amara.chen@lumio.dev — expires in 7 days
</Text>
</View>
</Mount>
{/* Previous exports — Google Takeout keeps past archives reachable
instead of pretending each export is the first. */}
{previousExports.length > 0 && (
<Mount delay={150} className="gap-1 px-6 pt-6">
<Text
variant="small"
className="pb-2 font-medium uppercase tracking-widest text-muted-foreground"
accessibilityRole="header"
>
Previous exports
</Text>
{previousExports.map((e) => (
<Glass interactive
key={e.id}
effect="regular"
className="flex-row items-center gap-3 rounded-2xl p-4"
>
<RowIcon name="package" tone="gray" />
<View className="flex-1">
<Text className="text-sm font-semibold">{e.label}</Text>
<Text variant="muted" className="text-xs">
{e.detail}
</Text>
</View>
{e.active ? (
<Button
variant="secondary"
size="sm"
haptic="light"
onPress={() => onDownloadExport?.(e.id)}
accessibilityLabel={`Download ${e.label}`}
className="h-8 px-3"
>
Download
</Button>
) : null}
</Glass>
))}
</Mount>
)}
{requesting && (
<View className="gap-2 px-8 pt-6">
<Text variant="small">Preparing your archive…</Text>
<Progress value={38} className="h-1.5" accessibilityLabel="Export progress" />
<Text variant="small" className="text-muted-foreground">
You can leave this page — we'll email you when it's ready.
</Text>
</View>
)}
</ScrollView>
<StickyBottomBar>
<Button
className="w-full bg-[#BEF04C]"
textClassName="text-[#1B1B26]"
haptic="medium"
onPress={() => {
haptics.medium();
setRequesting(true);
onRequestExport?.(selected);
}}
disabled={selected.length === 0 || requesting}
accessibilityLabel="Request data export"
>
{requesting ? "Preparing archive…" : "Request export"}
</Button>
</StickyBottomBar>
</SafeAreaView>
);
}
DataExportScreen.displayName = "DataExportScreen";
Recreate the "Export your data Screen" screen in React Native using LumioUI.
Goal: Category picker for a downloadable data archive with export history and progress. 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-data-export
```
Or pull just the components: `npx lumioui add button glass icon list progress 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.
- `<Button>` ×3
### `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>` ×4
### `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
### `progress` — Animated fill bar with indeterminate sweep mode.
- `<Progress>` ×1
### `text` — Themed type scale from caption to display.
- `<Text>` ×12
## 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/data-export.tsx` exporting DataExportScreen. 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 { Button, Glass, Icon, Progress, Text, } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { cn } from "@lumioui/core";
import { Mount, Press, RowIcon, StickyBottomBar } from "../shared";
export interface ExportCategory {
id: string;
label: string;
detail: string;
icon: React.ComponentProps<typeof RowIcon>["name"];
tone: React.ComponentProps<typeof RowIcon>["tone"];
}
export interface PreviousExport {
id: string;
/** e.g. "September export" */
label: string;
/** e.g. "1.9 GB · link expires Oct 2" */
detail: string;
/** When true the row offers a Download action; expired links show a
* quiet "Expired" state instead. */
active?: boolean;
}
export interface DataExportScreenProps {
categories?: ExportCategory[];
/** Earlier archives — the Takeout-style history under the builder. */
previousExports?: PreviousExport[];
onDownloadExport?: (id: string) => void;
/** Estimated archive size shown to the user. */
estimatedSize?: string;
/** Time the export stays available for download. */
expiryNote?: string;
onRequestExport?: (ids: string[]) => void;
onBack?: () => void;
}
const DEFAULT_PREVIOUS: PreviousExport[] = [
{ id: "e1", label: "September export", detail: "1.9 GB · link expires Oct 2", active: true },
{ id: "e2", label: "June export", detail: "1.4 GB · link expired", active: false },
];
const DEFAULT_CATEGORIES: ExportCategory[] = [
{ id: "profile", label: "Profile & settings", detail: "Account info, preferences", icon: "user", tone: "blue" },
{ id: "posts", label: "Posts & comments", detail: "Everything you've published", icon: "message-circle", tone: "green" },
{ id: "media", label: "Photos & videos", detail: "Original quality, in folders", icon: "image", tone: "purple" },
{ id: "activity", label: "Activity log", detail: "Sign-ins and security events", icon: "clock", tone: "orange" },
];
/** Data export — pick categories, request an archive, see progress. */
export function DataExportScreen({
categories = DEFAULT_CATEGORIES,
previousExports = DEFAULT_PREVIOUS,
onDownloadExport,
estimatedSize = "~2.1 GB",
expiryNote = "The download link stays live for 7 days.",
onRequestExport,
onBack,
}: DataExportScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [selected, setSelected] = React.useState<string[]>(
categories.map((c) => c.id)
);
const [requesting, setRequesting] = React.useState(false);
const toggle = (id: string) => () => {
haptics.selection();
setSelected((prev) =>
prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]
);
};
return (
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
{/* Floating chrome — back pill + hug-label 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"
>
<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>
</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">
Export data
</Text>
</Glass>
</View>
</View>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingTop: insets.top + 60, paddingBottom: insets.bottom + 120 }}
>
<Mount className="px-6 pb-4 pt-2">
<Text variant="small" className="text-muted-foreground">
We'll bundle everything into a single archive and email you a
download link — usually within a few hours.
</Text>
</Mount>
{/* Archive builder — selectable category tiles in a 2-col grid
rather than a checklist; the estimate sits above the CTA. */}
<Mount delay={60} className="px-6">
<Text
variant="small"
className="pb-3 font-medium uppercase tracking-widest text-muted-foreground"
accessibilityRole="header"
>
Include
</Text>
<View className="flex-row flex-wrap gap-3">
{categories.map((c) => {
const checked = selected.includes(c.id);
return (
<Press
key={c.id}
haptic="light"
pressedScale={0.97}
onPress={toggle(c.id)}
accessibilityRole="checkbox"
accessibilityState={{ checked }}
accessibilityLabel={c.label}
className="w-[48%]"
>
<Glass interactive
effect="regular"
className={cn(
"gap-2 rounded-2xl border-2 p-4",
checked ? "border-[#BEF04C]" : "border-transparent"
)}
>
<View className="flex-row items-start justify-between">
<RowIcon name={c.icon} tone={c.tone} />
<View
className={cn(
"h-5 w-5 items-center justify-center rounded-full border",
checked ? "border-[#BEF04C] bg-[#BEF04C]" : "border-border"
)}
>
{checked && <Icon name="check" size="sm" color="#1B1B26" />}
</View>
</View>
<View>
<Text className={cn("text-sm font-semibold", !checked && "text-muted-foreground")}>
{c.label}
</Text>
<Text variant="muted" className="text-xs">
{c.detail}
</Text>
</View>
</Glass>
</Press>
);
})}
</View>
</Mount>
<Mount delay={120} className="gap-1 px-8 pt-4">
<Text variant="small" className="text-muted-foreground">
Estimated size {estimatedSize} · {expiryNote}
</Text>
</Mount>
{/* Destination — where the link lands, stated once so the CTA
doesn't leave the user guessing. */}
<Mount delay={120} className="px-6 pt-4">
<View className="flex-row items-center gap-2">
<Icon name="mail" size="sm" color="mutedForeground" />
<Text variant="muted" className="text-xs">
Download link goes to amara.chen@lumio.dev — expires in 7 days
</Text>
</View>
</Mount>
{/* Previous exports — Google Takeout keeps past archives reachable
instead of pretending each export is the first. */}
{previousExports.length > 0 && (
<Mount delay={150} className="gap-1 px-6 pt-6">
<Text
variant="small"
className="pb-2 font-medium uppercase tracking-widest text-muted-foreground"
accessibilityRole="header"
>
Previous exports
</Text>
{previousExports.map((e) => (
<Glass interactive
key={e.id}
effect="regular"
className="flex-row items-center gap-3 rounded-2xl p-4"
>
<RowIcon name="package" tone="gray" />
<View className="flex-1">
<Text className="text-sm font-semibold">{e.label}</Text>
<Text variant="muted" className="text-xs">
{e.detail}
</Text>
</View>
{e.active ? (
<Button
variant="secondary"
size="sm"
haptic="light"
onPress={() => onDownloadExport?.(e.id)}
accessibilityLabel={`Download ${e.label}`}
className="h-8 px-3"
>
Download
</Button>
) : null}
</Glass>
))}
</Mount>
)}
{requesting && (
<View className="gap-2 px-8 pt-6">
<Text variant="small">Preparing your archive…</Text>
<Progress value={38} className="h-1.5" accessibilityLabel="Export progress" />
<Text variant="small" className="text-muted-foreground">
You can leave this page — we'll email you when it's ready.
</Text>
</View>
)}
</ScrollView>
<StickyBottomBar>
<Button
className="w-full bg-[#BEF04C]"
textClassName="text-[#1B1B26]"
haptic="medium"
onPress={() => {
haptics.medium();
setRequesting(true);
onRequestExport?.(selected);
}}
disabled={selected.length === 0 || requesting}
accessibilityLabel="Request data export"
>
{requesting ? "Preparing archive…" : "Request export"}
</Button>
</StickyBottomBar>
</SafeAreaView>
);
}
DataExportScreen.displayName = "DataExportScreen";
```
Screen: https://lumioui.dev/screens/core-data-export