Topics + hero article + headlines
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Chip, Glass, Icon, Image, List, Text } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { Display, Mount, Press, StoryScrim, World } from "../shared";
export interface NewsArticle {
id: string;
source: string;
headline: string;
time: string;
imageUrl?: string;
tag?: string;
}
export interface NewsHomeScreenProps {
articles?: NewsArticle[];
topics?: string[];
onArticlePress?: (id: string) => void;
}
const DEFAULT_ARTICLES: NewsArticle[] = [
{
id: "n1",
source: "Reuters",
headline: "Markets steady as central banks hold rates",
time: "12m",
imageUrl: "https://images.unsplash.com/photo-1611974789855-9c2a0a7236a3?w=800&h=450&fit=crop&q=70&auto=format",
tag: "Business",
},
{
id: "n2",
source: "The Verge",
headline: "Liquid Glass ships to all supported iPhones",
time: "1h",
imageUrl: "https://images.unsplash.com/photo-1512941937669-90a1b58e7e9c?w=800&h=450&fit=crop&q=70&auto=format",
tag: "Tech",
},
{
id: "n3",
source: "BBC",
headline: "Lisbon's tram network runs on 90-year-old cars",
time: "3h",
tag: "Travel",
},
{
id: "n4",
source: "AP",
headline: "Portugal's cork harvest faces a drier decade",
time: "4h",
imageUrl: "https://images.unsplash.com/photo-1500382017468-9049fed747ef?w=800&h=450&fit=crop&q=70&auto=format",
tag: "World",
},
{
id: "n5",
source: "ESPN",
headline: "Under-21s storm the qualifiers in record time",
time: "5h",
tag: "Sport",
},
{
id: "n6",
source: "Wired",
headline: "The quiet return of the dumbphone",
time: "7h",
imageUrl: "https://images.unsplash.com/photo-1511707171634-5f897ff02aa9?w=800&h=450&fit=crop&q=70&auto=format",
tag: "Tech",
},
{
id: "n7",
source: "Monocle",
headline: "Copenhagen opens its first car-free district",
time: "9h",
tag: "Culture",
},
];
const TOPICS = ["Top", "World", "Tech", "Business", "Sport", "Culture"];
/** News home — topic chips + hero + headline rows. */
export function NewsHomeScreen({
articles = DEFAULT_ARTICLES,
topics = TOPICS,
onArticlePress,
}: NewsHomeScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [topic, setTopic] = React.useState("Top");
const visible =
topic === "Top" ? articles : articles.filter((a) => a.tag === topic);
const [hero, ...rest] = visible;
return (
<World primary="#65A30D">
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
<View className="px-4 pb-1 pt-2">
<Display className="text-4xl">Today</Display>
{/* Date + brief — a morning edition masthead. */}
<Text variant="muted" className="pt-0.5 text-xs">
{new Date().toLocaleDateString("en-US", { weekday: "long", month: "long", day: "numeric" })} · 9 stories in your brief
</Text>
</View>
{/* Topics — horizontal chip rail. */}
<ScrollView
horizontal
className="grow-0"
showsHorizontalScrollIndicator={false}
contentContainerStyle={{ gap: 8, paddingHorizontal: 16, paddingBottom: 6 }}
>
{topics.map((t) => (
<Chip
key={t}
variant="filter"
selected={topic === t}
onPress={() => {
haptics.selection();
setTopic(t);
}}
>
{t}
</Chip>
))}
</ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingBottom: insets.bottom + 32 }}
>
{/* Hero — full-bleed photo + headline scrim. */}
{hero && (
<Press
haptic="light"
onPress={() => onArticlePress?.(hero.id)}
accessibilityLabel={hero.headline}
className="relative mx-4 mt-2 overflow-hidden rounded-3xl p-0"
>
<Image
source={{ uri: hero.imageUrl }}
className="h-52 w-full bg-muted"
accessibilityLabel="Headline photo"
/>
<View className="absolute inset-x-0 bottom-0 h-20">
<StoryScrim edge="bottom" />
</View>
<View className="absolute inset-x-0 bottom-0 p-3">
<View className="mb-1 self-start rounded-full bg-[#BEF04C] px-2 py-0.5">
<Text className="text-[10px] font-semibold text-[#1B1B26]">
{hero.tag}
</Text>
</View>
<Text className="text-base font-semibold text-primary-foreground" numberOfLines={2}>
{hero.headline}
</Text>
<Text className="text-[10px] text-primary-foreground/70">
{hero.source} · {hero.time}
</Text>
</View>
</Press>
)}
{/* Headline rows — source · time + headline + optional thumb. */}
{rest.length > 0 && (
<Mount className="mx-4 mt-3 overflow-hidden rounded-3xl bg-white dark:bg-[#1A1A20]">
{rest.map((a, i) => (
<React.Fragment key={a.id}>
{i > 0 && <List.Separator />}
<Press
haptic="light"
onPress={() => onArticlePress?.(a.id)}
accessibilityLabel={a.headline}
className="flex-row items-center gap-3 px-4 py-3"
>
<View className="flex-1 items-start gap-1">
<Text className="text-xs text-muted-foreground">
{a.source} · {a.time}
</Text>
<Text className="text-sm font-medium" numberOfLines={2}>
{a.headline}
</Text>
</View>
{a.imageUrl ? (
<Image
source={{ uri: a.imageUrl }}
className="h-14 w-14 rounded-xl bg-muted"
accessibilityLabel=""
/>
) : (
<Icon name="chevron-right" size="sm" color="mutedForeground" />
)}
</Press>
</React.Fragment>
))}
</Mount>
)}
</ScrollView>
</SafeAreaView>
</World>
);
}
NewsHomeScreen.displayName = "NewsHomeScreen";
Recreate the "News Home Screen" screen in React Native using LumioUI.
Goal: Topics + hero article + headlines 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 misc-news-home
```
Or pull just the components: `npx lumioui add button chip 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
### `chip` — Compact selectable pill with press scale and ink overlay.
- `<Chip>` ×1
### `icon` — Lucide icon set mapped to theme colors and sizes.
- `<Icon>` ×1
### `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>` ×6 — Date + brief — a morning edition masthead.
## 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/misc/news-home.tsx` exporting NewsHomeScreen. 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 { Chip, Glass, Icon, Image, List, Text } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { Display, Mount, Press, StoryScrim, World } from "../shared";
export interface NewsArticle {
id: string;
source: string;
headline: string;
time: string;
imageUrl?: string;
tag?: string;
}
export interface NewsHomeScreenProps {
articles?: NewsArticle[];
topics?: string[];
onArticlePress?: (id: string) => void;
}
const DEFAULT_ARTICLES: NewsArticle[] = [
{
id: "n1",
source: "Reuters",
headline: "Markets steady as central banks hold rates",
time: "12m",
imageUrl: "https://images.unsplash.com/photo-1611974789855-9c2a0a7236a3?w=800&h=450&fit=crop&q=70&auto=format",
tag: "Business",
},
{
id: "n2",
source: "The Verge",
headline: "Liquid Glass ships to all supported iPhones",
time: "1h",
imageUrl: "https://images.unsplash.com/photo-1512941937669-90a1b58e7e9c?w=800&h=450&fit=crop&q=70&auto=format",
tag: "Tech",
},
{
id: "n3",
source: "BBC",
headline: "Lisbon's tram network runs on 90-year-old cars",
time: "3h",
tag: "Travel",
},
{
id: "n4",
source: "AP",
headline: "Portugal's cork harvest faces a drier decade",
time: "4h",
imageUrl: "https://images.unsplash.com/photo-1500382017468-9049fed747ef?w=800&h=450&fit=crop&q=70&auto=format",
tag: "World",
},
{
id: "n5",
source: "ESPN",
headline: "Under-21s storm the qualifiers in record time",
time: "5h",
tag: "Sport",
},
{
id: "n6",
source: "Wired",
headline: "The quiet return of the dumbphone",
time: "7h",
imageUrl: "https://images.unsplash.com/photo-1511707171634-5f897ff02aa9?w=800&h=450&fit=crop&q=70&auto=format",
tag: "Tech",
},
{
id: "n7",
source: "Monocle",
headline: "Copenhagen opens its first car-free district",
time: "9h",
tag: "Culture",
},
];
const TOPICS = ["Top", "World", "Tech", "Business", "Sport", "Culture"];
/** News home — topic chips + hero + headline rows. */
export function NewsHomeScreen({
articles = DEFAULT_ARTICLES,
topics = TOPICS,
onArticlePress,
}: NewsHomeScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [topic, setTopic] = React.useState("Top");
const visible =
topic === "Top" ? articles : articles.filter((a) => a.tag === topic);
const [hero, ...rest] = visible;
return (
<World primary="#65A30D">
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
<View className="px-4 pb-1 pt-2">
<Display className="text-4xl">Today</Display>
{/* Date + brief — a morning edition masthead. */}
<Text variant="muted" className="pt-0.5 text-xs">
{new Date().toLocaleDateString("en-US", { weekday: "long", month: "long", day: "numeric" })} · 9 stories in your brief
</Text>
</View>
{/* Topics — horizontal chip rail. */}
<ScrollView
horizontal
className="grow-0"
showsHorizontalScrollIndicator={false}
contentContainerStyle={{ gap: 8, paddingHorizontal: 16, paddingBottom: 6 }}
>
{topics.map((t) => (
<Chip
key={t}
variant="filter"
selected={topic === t}
onPress={() => {
haptics.selection();
setTopic(t);
}}
>
{t}
</Chip>
))}
</ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingBottom: insets.bottom + 32 }}
>
{/* Hero — full-bleed photo + headline scrim. */}
{hero && (
<Press
haptic="light"
onPress={() => onArticlePress?.(hero.id)}
accessibilityLabel={hero.headline}
className="relative mx-4 mt-2 overflow-hidden rounded-3xl p-0"
>
<Image
source={{ uri: hero.imageUrl }}
className="h-52 w-full bg-muted"
accessibilityLabel="Headline photo"
/>
<View className="absolute inset-x-0 bottom-0 h-20">
<StoryScrim edge="bottom" />
</View>
<View className="absolute inset-x-0 bottom-0 p-3">
<View className="mb-1 self-start rounded-full bg-[#BEF04C] px-2 py-0.5">
<Text className="text-[10px] font-semibold text-[#1B1B26]">
{hero.tag}
</Text>
</View>
<Text className="text-base font-semibold text-primary-foreground" numberOfLines={2}>
{hero.headline}
</Text>
<Text className="text-[10px] text-primary-foreground/70">
{hero.source} · {hero.time}
</Text>
</View>
</Press>
)}
{/* Headline rows — source · time + headline + optional thumb. */}
{rest.length > 0 && (
<Mount className="mx-4 mt-3 overflow-hidden rounded-3xl bg-white dark:bg-[#1A1A20]">
{rest.map((a, i) => (
<React.Fragment key={a.id}>
{i > 0 && <List.Separator />}
<Press
haptic="light"
onPress={() => onArticlePress?.(a.id)}
accessibilityLabel={a.headline}
className="flex-row items-center gap-3 px-4 py-3"
>
<View className="flex-1 items-start gap-1">
<Text className="text-xs text-muted-foreground">
{a.source} · {a.time}
</Text>
<Text className="text-sm font-medium" numberOfLines={2}>
{a.headline}
</Text>
</View>
{a.imageUrl ? (
<Image
source={{ uri: a.imageUrl }}
className="h-14 w-14 rounded-xl bg-muted"
accessibilityLabel=""
/>
) : (
<Icon name="chevron-right" size="sm" color="mutedForeground" />
)}
</Press>
</React.Fragment>
))}
</Mount>
)}
</ScrollView>
</SafeAreaView>
</World>
);
}
NewsHomeScreen.displayName = "NewsHomeScreen";
```
Screen: https://lumioui.dev/screens/misc-news-home