Bookmarked products in a two-column photo grid with remove action.
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Card, Chip, EmptyState, Glass, Icon, Image, Text } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { catalogImg, Mount, Press, BLOCK_STAGGER, type CatalogPhoto } from "../shared";
export interface SavedItem {
id: string;
title: string;
/** Shop, source, or collection name. */
source: string;
price?: string;
/** Board/collection the item was saved to — feeds the filter rail. */
collection?: string;
photo: CatalogPhoto;
}
export interface SavedItemsScreenProps {
items?: SavedItem[];
onItemPress?: (id: string) => void;
onRemove?: (id: string) => void;
onBack?: () => void;
}
const DEFAULT_ITEMS: SavedItem[] = [
{ id: "s1", title: "Oversized wool overcoat", source: "Atelier Nord", price: "$289", collection: "Outerwear", photo: "overcoat" },
{ id: "s2", title: "Raw denim jeans", source: "Selvedge & Co", price: "$148", collection: "Denim", photo: "denim" },
{ id: "s3", title: "Court leather sneaker", source: "Studio Veja", price: "$120", collection: "Footwear", photo: "sneakers" },
{ id: "s4", title: "Quilted puffer jacket", source: "Norda Supply", price: "$210", collection: "Outerwear", photo: "puffer" },
{ id: "s5", title: "Leather lace-up boots", source: "Grenson Works", price: "$265", collection: "Footwear", photo: "boots" },
{ id: "s6", title: "Sherpa denim jacket", source: "Railcar & Co", price: "$198", collection: "Denim", photo: "denimJacket" },
{ id: "s7", title: "Fringed knit poncho", source: "Andes Loom", price: "$156", collection: "Knitwear", photo: "poncho" },
{ id: "s8", title: "Checked wool blazer", source: "Sartoria Blu", price: "$310", collection: "Outerwear", photo: "blazer" },
];
/** Saved items — bookmarked products in a two-column photo grid. */
export function SavedItemsScreen({
items = DEFAULT_ITEMS,
onItemPress,
onRemove,
onBack,
}: SavedItemsScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [collection, setCollection] = React.useState("All");
// Local mirror so remove/filter actually respond in the demo even when the
// parent doesn't pass state back (product-grid pattern).
const [removedIds, setRemovedIds] = React.useState<ReadonlySet<string>>(new Set());
const saved = items.filter((i) => !removedIds.has(i.id));
const collections = React.useMemo(
() => [...new Set(items.map((i) => i.collection).filter((c): c is string => !!c))],
[items]
);
const shown = collection === "All" ? saved : saved.filter((i) => i.collection === collection);
return (
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
{/* Floating chrome — back disc + title pill + collections disc. */}
<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"
>
<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>
<Glass
effect="regular"
className="h-11 flex-row items-center gap-2 rounded-full px-4"
>
<Press haptic="light" accessibilityRole="button" accessibilityLabel="Manage collections">
<Icon name="grid" size="sm" color="foreground" />
</Press>
<Text variant="small" className="font-semibold text-muted-foreground">
{saved.length}
</Text>
</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">
Saved
</Text>
</Glass>
</View>
</View>
{collections.length > 0 && (
<Mount delay={BLOCK_STAGGER}>
<ScrollView
horizontal
className="grow-0"
showsHorizontalScrollIndicator={false}
style={{ paddingTop: insets.top + 60 }}
contentContainerStyle={{ gap: 8, paddingHorizontal: 16, paddingBottom: 6 }}
>
{["All", ...collections].map((c) => (
<Chip
key={c}
variant="filter"
selected={collection === c}
selectedClassName="border-[#BEF04C] bg-[#BEF04C]"
selectedTextClassName="font-semibold text-[#1B1B26]"
onPress={() => {
haptics.selection();
setCollection(c);
}}
>
{c}
</Chip>
))}
</ScrollView>
</Mount>
)}
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{
paddingTop: collections.length > 0 ? 0 : insets.top + 60,
paddingBottom: insets.bottom + 32,
paddingHorizontal: 16,
}}
>
<Mount delay={BLOCK_STAGGER * 2}>
{shown.length === 0 ? (
<EmptyState
icon={<Icon name="bookmark" size="lg" color="mutedForeground" />}
title={collection === "All" ? "Nothing saved yet" : `Nothing in ${collection}`}
description="Items you bookmark will show up here."
className="mt-16"
/>
) : (
<View className="flex-row flex-wrap justify-between gap-y-4">
{shown.map((item) => (
// Remove control is a sibling of the pressable Card, not a
// child — nested pressables render as <button> in <button>
// on web (invalid HTML, hydration errors).
<View key={item.id} className="w-[48%]">
<Card
className="overflow-hidden border-0 p-0"
onPress={() => onItemPress?.(item.id)}
accessibilityLabel={`${item.title}, ${item.price ?? "saved item"}`}
>
<Image
source={{ uri: catalogImg(item.photo, 400, 500) }}
className="aspect-[4/5] w-full rounded-3xl bg-muted"
accessibilityLabel={item.title}
/>
<View className="gap-0.5 px-1 pb-1 pt-2">
<Text variant="small" numberOfLines={1}>
{item.title}
</Text>
<View className="flex-row items-baseline justify-between">
<Text variant="small" className="text-muted-foreground" numberOfLines={1}>
{item.source}
</Text>
{item.price && (
<Text variant="small" className="font-semibold">
{item.price}
</Text>
)}
</View>
</View>
</Card>
<View className="absolute right-2 top-2 rounded-full bg-[#BEF04C]">
<Press
onPress={() => {
haptics.selection();
setRemovedIds((prev) => new Set(prev).add(item.id));
onRemove?.(item.id);
}}
accessibilityRole="button"
accessibilityLabel={`Remove ${item.title} from saved`}
hitSlop={12}
className="h-9 w-9 items-center justify-center rounded-full"
>
<Icon name="bookmark" size="sm" color="#1B1B26" filled />
</Press>
</View>
</View>
))}
</View>
)}
</Mount>
</ScrollView>
</SafeAreaView>
);
}
SavedItemsScreen.displayName = "SavedItemsScreen";
Recreate the "Saved items Screen" screen in React Native using LumioUI.
Goal: Bookmarked products in a two-column photo grid with remove action. 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-saved-items
```
Or pull just the components: `npx lumioui add button card chip empty-state glass icon image 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
### `card` — Compound surface — header, title, content and footer slots.
- `<Card>` ×1
### `chip` — Compact selectable pill with press scale and ink overlay.
- `<Chip>` ×1
### `empty-state` — Illustrated placeholder with title, copy and action slot.
- `<EmptyState>` ×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>` ×3
### `icon` — Lucide icon set mapped to theme colors and sizes.
- `<Icon>` ×4
### `image` — Cached image with placeholder, fallback and aspect handling.
- `<Image>` ×1
### `text` — Themed type scale from caption to display.
- `<Text>` ×5
## 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/saved-items.tsx` exporting SavedItemsScreen. 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 { Card, Chip, EmptyState, Glass, Icon, Image, Text } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { catalogImg, Mount, Press, BLOCK_STAGGER, type CatalogPhoto } from "../shared";
export interface SavedItem {
id: string;
title: string;
/** Shop, source, or collection name. */
source: string;
price?: string;
/** Board/collection the item was saved to — feeds the filter rail. */
collection?: string;
photo: CatalogPhoto;
}
export interface SavedItemsScreenProps {
items?: SavedItem[];
onItemPress?: (id: string) => void;
onRemove?: (id: string) => void;
onBack?: () => void;
}
const DEFAULT_ITEMS: SavedItem[] = [
{ id: "s1", title: "Oversized wool overcoat", source: "Atelier Nord", price: "$289", collection: "Outerwear", photo: "overcoat" },
{ id: "s2", title: "Raw denim jeans", source: "Selvedge & Co", price: "$148", collection: "Denim", photo: "denim" },
{ id: "s3", title: "Court leather sneaker", source: "Studio Veja", price: "$120", collection: "Footwear", photo: "sneakers" },
{ id: "s4", title: "Quilted puffer jacket", source: "Norda Supply", price: "$210", collection: "Outerwear", photo: "puffer" },
{ id: "s5", title: "Leather lace-up boots", source: "Grenson Works", price: "$265", collection: "Footwear", photo: "boots" },
{ id: "s6", title: "Sherpa denim jacket", source: "Railcar & Co", price: "$198", collection: "Denim", photo: "denimJacket" },
{ id: "s7", title: "Fringed knit poncho", source: "Andes Loom", price: "$156", collection: "Knitwear", photo: "poncho" },
{ id: "s8", title: "Checked wool blazer", source: "Sartoria Blu", price: "$310", collection: "Outerwear", photo: "blazer" },
];
/** Saved items — bookmarked products in a two-column photo grid. */
export function SavedItemsScreen({
items = DEFAULT_ITEMS,
onItemPress,
onRemove,
onBack,
}: SavedItemsScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [collection, setCollection] = React.useState("All");
// Local mirror so remove/filter actually respond in the demo even when the
// parent doesn't pass state back (product-grid pattern).
const [removedIds, setRemovedIds] = React.useState<ReadonlySet<string>>(new Set());
const saved = items.filter((i) => !removedIds.has(i.id));
const collections = React.useMemo(
() => [...new Set(items.map((i) => i.collection).filter((c): c is string => !!c))],
[items]
);
const shown = collection === "All" ? saved : saved.filter((i) => i.collection === collection);
return (
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
{/* Floating chrome — back disc + title pill + collections disc. */}
<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"
>
<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>
<Glass
effect="regular"
className="h-11 flex-row items-center gap-2 rounded-full px-4"
>
<Press haptic="light" accessibilityRole="button" accessibilityLabel="Manage collections">
<Icon name="grid" size="sm" color="foreground" />
</Press>
<Text variant="small" className="font-semibold text-muted-foreground">
{saved.length}
</Text>
</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">
Saved
</Text>
</Glass>
</View>
</View>
{collections.length > 0 && (
<Mount delay={BLOCK_STAGGER}>
<ScrollView
horizontal
className="grow-0"
showsHorizontalScrollIndicator={false}
style={{ paddingTop: insets.top + 60 }}
contentContainerStyle={{ gap: 8, paddingHorizontal: 16, paddingBottom: 6 }}
>
{["All", ...collections].map((c) => (
<Chip
key={c}
variant="filter"
selected={collection === c}
selectedClassName="border-[#BEF04C] bg-[#BEF04C]"
selectedTextClassName="font-semibold text-[#1B1B26]"
onPress={() => {
haptics.selection();
setCollection(c);
}}
>
{c}
</Chip>
))}
</ScrollView>
</Mount>
)}
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{
paddingTop: collections.length > 0 ? 0 : insets.top + 60,
paddingBottom: insets.bottom + 32,
paddingHorizontal: 16,
}}
>
<Mount delay={BLOCK_STAGGER * 2}>
{shown.length === 0 ? (
<EmptyState
icon={<Icon name="bookmark" size="lg" color="mutedForeground" />}
title={collection === "All" ? "Nothing saved yet" : `Nothing in ${collection}`}
description="Items you bookmark will show up here."
className="mt-16"
/>
) : (
<View className="flex-row flex-wrap justify-between gap-y-4">
{shown.map((item) => (
// Remove control is a sibling of the pressable Card, not a
// child — nested pressables render as <button> in <button>
// on web (invalid HTML, hydration errors).
<View key={item.id} className="w-[48%]">
<Card
className="overflow-hidden border-0 p-0"
onPress={() => onItemPress?.(item.id)}
accessibilityLabel={`${item.title}, ${item.price ?? "saved item"}`}
>
<Image
source={{ uri: catalogImg(item.photo, 400, 500) }}
className="aspect-[4/5] w-full rounded-3xl bg-muted"
accessibilityLabel={item.title}
/>
<View className="gap-0.5 px-1 pb-1 pt-2">
<Text variant="small" numberOfLines={1}>
{item.title}
</Text>
<View className="flex-row items-baseline justify-between">
<Text variant="small" className="text-muted-foreground" numberOfLines={1}>
{item.source}
</Text>
{item.price && (
<Text variant="small" className="font-semibold">
{item.price}
</Text>
)}
</View>
</View>
</Card>
<View className="absolute right-2 top-2 rounded-full bg-[#BEF04C]">
<Press
onPress={() => {
haptics.selection();
setRemovedIds((prev) => new Set(prev).add(item.id));
onRemove?.(item.id);
}}
accessibilityRole="button"
accessibilityLabel={`Remove ${item.title} from saved`}
hitSlop={12}
className="h-9 w-9 items-center justify-center rounded-full"
>
<Icon name="bookmark" size="sm" color="#1B1B26" filled />
</Press>
</View>
</View>
))}
</View>
)}
</Mount>
</ScrollView>
</SafeAreaView>
);
}
SavedItemsScreen.displayName = "SavedItemsScreen";
```
Screen: https://lumioui.dev/screens/core-saved-items