Browsable departments with featured collection card.
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Glass, Icon, Image, Text } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { BLOCK_STAGGER, LumioMark, Mount, Press, StoryScrim, catalogImg } from "../shared";
export interface Category {
id: string;
name: string;
/** e.g. "48 items" */
count: string;
/** Thumbnail URL for the row's leading tile. */
imageUrl?: string;
}
export interface CategoryListScreenProps {
categories?: Category[];
featured?: { name: string; tagline: string; imageUrl?: string };
onCategoryPress?: (id: string) => void;
onFeaturedPress?: () => void;
onSearchPress?: () => void;
onBack?: () => void;
}
const DEFAULT_CATEGORIES: Category[] = [
{ id: "outerwear", name: "Outerwear", count: "48 items", imageUrl: catalogImg("puffer") },
{ id: "knitwear", name: "Knitwear", count: "36 items", imageUrl: catalogImg("poncho") },
{ id: "denim", name: "Denim", count: "52 items", imageUrl: catalogImg("denim") },
{ id: "tailoring", name: "Tailoring", count: "19 items", imageUrl: catalogImg("blazer") },
{ id: "footwear", name: "Footwear", count: "41 items", imageUrl: catalogImg("boots") },
{ id: "tees", name: "Tees & basics", count: "58 items", imageUrl: catalogImg("tee") },
{ id: "activewear", name: "Activewear", count: "24 items", imageUrl: catalogImg("runner") },
{ id: "accessories", name: "Accessories", count: "27 items", imageUrl: catalogImg("flatlay") },
];
/** Category list — browsable departments with counts (iOS app store idiom). */
export function CategoryListScreen({
categories = DEFAULT_CATEGORIES,
featured = {
name: "The Autumn Edit",
tagline: "Layers that carry the season",
imageUrl: catalogImg("overcoat", 800, 400),
},
onCategoryPress,
onFeaturedPress,
onSearchPress,
onBack,
}: CategoryListScreenProps) {
const insets = useSafeAreaInsets();
const haptics = useHaptic();
return (
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
{/* Floating chrome — back disc + centered title pill + search 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 w-11 items-center justify-center rounded-full"
>
<Press
onPress={() => {
haptics.light();
onSearchPress?.();
}}
accessibilityLabel="Search products"
accessibilityRole="button"
className="h-9 w-9 items-center justify-center"
>
<Icon name="search" size="md" color="foreground" />
</Press>
</Glass>
</View>
<View pointerEvents="none" className="absolute inset-0 items-center justify-center">
<View className="h-11 flex-row items-center justify-center gap-2 rounded-full pl-3.5 pr-5">
<Glass
effect="regular"
className="absolute inset-0 rounded-full"
/>
<LumioMark size={20} />
<Text accessibilityRole="header" className="text-sm font-bold tracking-tight">
Lumio Market
</Text>
</View>
</View>
</View>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingTop: insets.top + 56, paddingBottom: insets.bottom + 32 }}
>
{/* Featured collection — one strong card, not a carousel of noise. */}
<Mount delay={BLOCK_STAGGER}>
<View className="px-6 pb-6 pt-2">
<Press
pressedScale={0.97}
haptic="light"
onPress={() => onFeaturedPress?.()}
accessibilityLabel={`${featured.name} collection`}
accessibilityRole="button"
>
<View className="relative h-44 overflow-hidden rounded-3xl bg-muted">
<Image
source={featured.imageUrl ? { uri: featured.imageUrl } : undefined}
className="absolute inset-0 h-full w-full"
accessibilityElementsHidden
importantForAccessibility="no"
/>
<View className="absolute inset-x-0 bottom-0 h-24">
<StoryScrim edge="bottom" />
</View>
<View className="absolute inset-x-0 bottom-0 gap-0.5 px-5 py-4">
<Text variant="large" className="text-white">
{featured.name}
</Text>
<Text variant="small" className="text-white/80">
{featured.tagline}
</Text>
{/* Count chip — store browsers want to know depth. */}
<View className="mt-1.5 self-start rounded-full bg-[#BEF04C] px-2.5 py-0.5">
<Text className="text-[11px] font-semibold text-[#1B1B26]">
148 products
</Text>
</View>
</View>
</View>
</Press>
</View>
</Mount>
{/* Departments as staggered photo tiles — asymmetric heights keep
it editorial instead of a grid of identical cards. */}
<Mount delay={BLOCK_STAGGER * 2}>
<View className="px-6">
<Text
variant="muted"
className="pb-3 text-xs font-medium uppercase tracking-wider"
accessibilityRole="header"
>
Departments
</Text>
<View className="flex-row gap-3">
{[0, 1].map((col) => (
<View key={col} className="flex-1 gap-3">
{categories
.filter((_, i) => i % 2 === col)
.map((cat, i) => (
<Press
key={cat.id}
pressedScale={0.97}
haptic="light"
onPress={() => onCategoryPress?.(cat.id)}
accessibilityLabel={`${cat.name}, ${cat.count}`}
accessibilityRole="button"
>
<View
className={`relative w-full overflow-hidden rounded-2xl bg-muted ${
(i + col) % 2 === 0 ? "aspect-[3/4]" : "aspect-[4/5]"
}`}
>
<Image
source={cat.imageUrl ? { uri: cat.imageUrl } : undefined}
className="absolute inset-0 h-full w-full"
accessibilityElementsHidden
importantForAccessibility="no"
/>
<View className="absolute inset-x-0 bottom-0 h-16">
<StoryScrim edge="bottom" />
</View>
<View className="absolute inset-x-0 bottom-0 px-3.5 pb-3">
<Text className="text-sm font-semibold text-white">
{cat.name}
</Text>
<Text className="text-[11px] text-white/75">
{cat.count}
</Text>
</View>
</View>
</Press>
))}
</View>
))}
</View>
</View>
</Mount>
</ScrollView>
</SafeAreaView>
);
}
CategoryListScreen.displayName = "CategoryListScreen";
Recreate the "Categories Screen" screen in React Native using LumioUI.
Goal: Browsable departments with featured collection card. 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 ecommerce-category-list
```
Or pull just the components: `npx lumioui add button icon image 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
### `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>` ×2
### `image` — Cached image with placeholder, fallback and aspect handling.
- `<Image>` ×2
### `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>` ×7
## 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/ecommerce/category-list.tsx` exporting CategoryListScreen. 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, Image, Text } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { BLOCK_STAGGER, LumioMark, Mount, Press, StoryScrim, catalogImg } from "../shared";
export interface Category {
id: string;
name: string;
/** e.g. "48 items" */
count: string;
/** Thumbnail URL for the row's leading tile. */
imageUrl?: string;
}
export interface CategoryListScreenProps {
categories?: Category[];
featured?: { name: string; tagline: string; imageUrl?: string };
onCategoryPress?: (id: string) => void;
onFeaturedPress?: () => void;
onSearchPress?: () => void;
onBack?: () => void;
}
const DEFAULT_CATEGORIES: Category[] = [
{ id: "outerwear", name: "Outerwear", count: "48 items", imageUrl: catalogImg("puffer") },
{ id: "knitwear", name: "Knitwear", count: "36 items", imageUrl: catalogImg("poncho") },
{ id: "denim", name: "Denim", count: "52 items", imageUrl: catalogImg("denim") },
{ id: "tailoring", name: "Tailoring", count: "19 items", imageUrl: catalogImg("blazer") },
{ id: "footwear", name: "Footwear", count: "41 items", imageUrl: catalogImg("boots") },
{ id: "tees", name: "Tees & basics", count: "58 items", imageUrl: catalogImg("tee") },
{ id: "activewear", name: "Activewear", count: "24 items", imageUrl: catalogImg("runner") },
{ id: "accessories", name: "Accessories", count: "27 items", imageUrl: catalogImg("flatlay") },
];
/** Category list — browsable departments with counts (iOS app store idiom). */
export function CategoryListScreen({
categories = DEFAULT_CATEGORIES,
featured = {
name: "The Autumn Edit",
tagline: "Layers that carry the season",
imageUrl: catalogImg("overcoat", 800, 400),
},
onCategoryPress,
onFeaturedPress,
onSearchPress,
onBack,
}: CategoryListScreenProps) {
const insets = useSafeAreaInsets();
const haptics = useHaptic();
return (
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
{/* Floating chrome — back disc + centered title pill + search 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 w-11 items-center justify-center rounded-full"
>
<Press
onPress={() => {
haptics.light();
onSearchPress?.();
}}
accessibilityLabel="Search products"
accessibilityRole="button"
className="h-9 w-9 items-center justify-center"
>
<Icon name="search" size="md" color="foreground" />
</Press>
</Glass>
</View>
<View pointerEvents="none" className="absolute inset-0 items-center justify-center">
<View className="h-11 flex-row items-center justify-center gap-2 rounded-full pl-3.5 pr-5">
<Glass
effect="regular"
className="absolute inset-0 rounded-full"
/>
<LumioMark size={20} />
<Text accessibilityRole="header" className="text-sm font-bold tracking-tight">
Lumio Market
</Text>
</View>
</View>
</View>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingTop: insets.top + 56, paddingBottom: insets.bottom + 32 }}
>
{/* Featured collection — one strong card, not a carousel of noise. */}
<Mount delay={BLOCK_STAGGER}>
<View className="px-6 pb-6 pt-2">
<Press
pressedScale={0.97}
haptic="light"
onPress={() => onFeaturedPress?.()}
accessibilityLabel={`${featured.name} collection`}
accessibilityRole="button"
>
<View className="relative h-44 overflow-hidden rounded-3xl bg-muted">
<Image
source={featured.imageUrl ? { uri: featured.imageUrl } : undefined}
className="absolute inset-0 h-full w-full"
accessibilityElementsHidden
importantForAccessibility="no"
/>
<View className="absolute inset-x-0 bottom-0 h-24">
<StoryScrim edge="bottom" />
</View>
<View className="absolute inset-x-0 bottom-0 gap-0.5 px-5 py-4">
<Text variant="large" className="text-white">
{featured.name}
</Text>
<Text variant="small" className="text-white/80">
{featured.tagline}
</Text>
{/* Count chip — store browsers want to know depth. */}
<View className="mt-1.5 self-start rounded-full bg-[#BEF04C] px-2.5 py-0.5">
<Text className="text-[11px] font-semibold text-[#1B1B26]">
148 products
</Text>
</View>
</View>
</View>
</Press>
</View>
</Mount>
{/* Departments as staggered photo tiles — asymmetric heights keep
it editorial instead of a grid of identical cards. */}
<Mount delay={BLOCK_STAGGER * 2}>
<View className="px-6">
<Text
variant="muted"
className="pb-3 text-xs font-medium uppercase tracking-wider"
accessibilityRole="header"
>
Departments
</Text>
<View className="flex-row gap-3">
{[0, 1].map((col) => (
<View key={col} className="flex-1 gap-3">
{categories
.filter((_, i) => i % 2 === col)
.map((cat, i) => (
<Press
key={cat.id}
pressedScale={0.97}
haptic="light"
onPress={() => onCategoryPress?.(cat.id)}
accessibilityLabel={`${cat.name}, ${cat.count}`}
accessibilityRole="button"
>
<View
className={`relative w-full overflow-hidden rounded-2xl bg-muted ${
(i + col) % 2 === 0 ? "aspect-[3/4]" : "aspect-[4/5]"
}`}
>
<Image
source={cat.imageUrl ? { uri: cat.imageUrl } : undefined}
className="absolute inset-0 h-full w-full"
accessibilityElementsHidden
importantForAccessibility="no"
/>
<View className="absolute inset-x-0 bottom-0 h-16">
<StoryScrim edge="bottom" />
</View>
<View className="absolute inset-x-0 bottom-0 px-3.5 pb-3">
<Text className="text-sm font-semibold text-white">
{cat.name}
</Text>
<Text className="text-[11px] text-white/75">
{cat.count}
</Text>
</View>
</View>
</Press>
))}
</View>
))}
</View>
</View>
</Mount>
</ScrollView>
</SafeAreaView>
);
}
CategoryListScreen.displayName = "CategoryListScreen";
```
Screen: https://lumioui.dev/screens/ecommerce-category-list