Hashtag header and post grid
import * as React from "react";
import { ScrollView, View } from "react-native";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import { Button, Glass, Icon, Image, Text } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { Mount, Press, World } from "../shared";
export interface HashtagPost {
id: string;
uri: string;
author: string;
}
export interface HashtagFeedScreenProps {
tag?: string;
postCount?: string;
posts?: HashtagPost[];
onPostPress?: (id: string) => void;
onBack?: () => void;
}
const pic = (id: string) =>
`https://images.unsplash.com/photo-${id}?w=400&h=400&fit=crop&q=60&auto=format`;
const DEFAULT_POSTS: HashtagPost[] = [
{ id: "h1", uri: pic("1555881400-74d7acaacd8b"), author: "amara.makes" },
{ id: "h2", uri: pic("1516483638261-f4dbaf036963"), author: "noahshoots" },
{ id: "h3", uri: pic("1499856871958-5b9627545d1a"), author: "priya.codes" },
{ id: "h4", uri: pic("1488646953014-85cb44e25828"), author: "tariqaz" },
{ id: "h5", uri: pic("1476514525535-07fb3b4ae5f1"), author: "lenak" },
{ id: "h6", uri: pic("1533105079780-92b9be482077"), author: "sofi.makes" },
{ id: "h7", uri: pic("1493976040374-85c8e12f0c0e"), author: "noahshoots" },
{ id: "h8", uri: pic("1506905925346-21bda4d32df4"), author: "amara.makes" },
{ id: "h9", uri: pic("1566073771259-6a8506099945"), author: "lenak" },
{ id: "h10", uri: pic("1585208798174-6cedd86e019a"), author: "tariqaz" },
{ id: "h11", uri: pic("1548707309-dcebeab9ea9b"), author: "sofi.makes" },
{ id: "h12", uri: pic("1513735492246-483525079686"), author: "noahshoots" },
{ id: "h13", uri: pic("1569959220744-ff553533f492"), author: "priya.codes" },
{ id: "h14", uri: pic("1502920514313-52581002a659"), author: "lenak" },
{ id: "h15", uri: pic("1538332576228-eb5b4c4de6f5"), author: "amara.makes" },
{ id: "h16", uri: pic("1523531294919-4bcd7c65e216"), author: "tariqaz" },
{ id: "h17", uri: pic("1501594907352-04cda38ebc29"), author: "sofi.makes" },
];
/** Hashtag feed — tag header with count + follow + 3-col post grid. */
export function HashtagFeedScreen({
tag = "lisbon",
postCount = "2.1M",
posts = DEFAULT_POSTS,
onPostPress,
onBack,
}: HashtagFeedScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [following, setFollowing] = React.useState(false);
return (
<World primary="#65A30D">
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
<View className="flex-row items-center gap-2 px-4 pb-1 pt-2">
<Button
variant="ghost"
size="icon"
haptic="light"
onPress={() => onBack?.()}
accessibilityLabel="Go back"
className="-ml-2 h-10 w-10"
>
<Icon name="chevron-left" size="md" color="foreground" />
</Button>
<Text variant="h2" accessibilityRole="header" numberOfLines={1}>
#{tag}
</Text>
</View>
{/* Tag header — count + follow pill. */}
<View className="flex-row items-center justify-between px-4 py-3">
<Mount className="flex-row items-center gap-3">
<View className="h-12 w-12 items-center justify-center overflow-hidden rounded-full">
<Glass interactive effect="clear" sheen={0.5} className="absolute inset-0 rounded-full" pointerEvents="none" />
<Text className="text-xl font-bold text-[#65A30D]">#</Text>
</View>
<View>
<Text className="text-base font-semibold">#{tag}</Text>
<Text className="text-xs text-muted-foreground">
{postCount} posts
</Text>
{/* Trending badge — tags answer "is this hot right now". */}
<View className="mt-0.5 flex-row items-center gap-1">
<Icon name="flame" size="sm" color="warning" />
<Text className="text-[10px] font-medium text-warning">
Trending this week
</Text>
</View>
</View>
</Mount>
<Button
variant={following ? "secondary" : "default"}
size="sm"
haptic="light"
onPress={() => {
haptics.selection();
setFollowing((f) => !f);
}}
accessibilityLabel={following ? `Following #${tag}` : `Follow #${tag}`}
accessibilityState={{ checked: following }}
className="h-8 px-3"
>
{following ? "Following" : "Follow"}
</Button>
</View>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingBottom: insets.bottom + 24 }}
>
<Mount delay={60} className="flex-row flex-wrap px-1">
{posts.map((p) => (
<Press
key={p.id}
haptic="light"
onPress={() => onPostPress?.(p.id)}
accessibilityLabel={`Post by ${p.author}`}
className="w-1/3 p-1"
>
<Image
source={{ uri: p.uri }}
className="aspect-square w-full rounded-2xl bg-muted"
accessibilityLabel={`Photo by ${p.author}`}
/>
</Press>
))}
</Mount>
</ScrollView>
</SafeAreaView>
</World>
);
}
HashtagFeedScreen.displayName = "HashtagFeedScreen";
Recreate the "Hashtag Feed Screen" screen in React Native using LumioUI.
Goal: Hashtag header and post grid 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 social-hashtag-feed
```
Or pull just the components: `npx lumioui add button 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.
- `<Button>` ×2
### `icon` — Lucide icon set mapped to theme colors and sizes.
- `<Icon>` ×2
### `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/social/hashtag-feed.tsx` exporting HashtagFeedScreen. 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, Image, Text } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { Mount, Press, World } from "../shared";
export interface HashtagPost {
id: string;
uri: string;
author: string;
}
export interface HashtagFeedScreenProps {
tag?: string;
postCount?: string;
posts?: HashtagPost[];
onPostPress?: (id: string) => void;
onBack?: () => void;
}
const pic = (id: string) =>
`https://images.unsplash.com/photo-${id}?w=400&h=400&fit=crop&q=60&auto=format`;
const DEFAULT_POSTS: HashtagPost[] = [
{ id: "h1", uri: pic("1555881400-74d7acaacd8b"), author: "amara.makes" },
{ id: "h2", uri: pic("1516483638261-f4dbaf036963"), author: "noahshoots" },
{ id: "h3", uri: pic("1499856871958-5b9627545d1a"), author: "priya.codes" },
{ id: "h4", uri: pic("1488646953014-85cb44e25828"), author: "tariqaz" },
{ id: "h5", uri: pic("1476514525535-07fb3b4ae5f1"), author: "lenak" },
{ id: "h6", uri: pic("1533105079780-92b9be482077"), author: "sofi.makes" },
{ id: "h7", uri: pic("1493976040374-85c8e12f0c0e"), author: "noahshoots" },
{ id: "h8", uri: pic("1506905925346-21bda4d32df4"), author: "amara.makes" },
{ id: "h9", uri: pic("1566073771259-6a8506099945"), author: "lenak" },
{ id: "h10", uri: pic("1585208798174-6cedd86e019a"), author: "tariqaz" },
{ id: "h11", uri: pic("1548707309-dcebeab9ea9b"), author: "sofi.makes" },
{ id: "h12", uri: pic("1513735492246-483525079686"), author: "noahshoots" },
{ id: "h13", uri: pic("1569959220744-ff553533f492"), author: "priya.codes" },
{ id: "h14", uri: pic("1502920514313-52581002a659"), author: "lenak" },
{ id: "h15", uri: pic("1538332576228-eb5b4c4de6f5"), author: "amara.makes" },
{ id: "h16", uri: pic("1523531294919-4bcd7c65e216"), author: "tariqaz" },
{ id: "h17", uri: pic("1501594907352-04cda38ebc29"), author: "sofi.makes" },
];
/** Hashtag feed — tag header with count + follow + 3-col post grid. */
export function HashtagFeedScreen({
tag = "lisbon",
postCount = "2.1M",
posts = DEFAULT_POSTS,
onPostPress,
onBack,
}: HashtagFeedScreenProps) {
const haptics = useHaptic();
const insets = useSafeAreaInsets();
const [following, setFollowing] = React.useState(false);
return (
<World primary="#65A30D">
<SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
<View className="flex-row items-center gap-2 px-4 pb-1 pt-2">
<Button
variant="ghost"
size="icon"
haptic="light"
onPress={() => onBack?.()}
accessibilityLabel="Go back"
className="-ml-2 h-10 w-10"
>
<Icon name="chevron-left" size="md" color="foreground" />
</Button>
<Text variant="h2" accessibilityRole="header" numberOfLines={1}>
#{tag}
</Text>
</View>
{/* Tag header — count + follow pill. */}
<View className="flex-row items-center justify-between px-4 py-3">
<Mount className="flex-row items-center gap-3">
<View className="h-12 w-12 items-center justify-center overflow-hidden rounded-full">
<Glass interactive effect="clear" sheen={0.5} className="absolute inset-0 rounded-full" pointerEvents="none" />
<Text className="text-xl font-bold text-[#65A30D]">#</Text>
</View>
<View>
<Text className="text-base font-semibold">#{tag}</Text>
<Text className="text-xs text-muted-foreground">
{postCount} posts
</Text>
{/* Trending badge — tags answer "is this hot right now". */}
<View className="mt-0.5 flex-row items-center gap-1">
<Icon name="flame" size="sm" color="warning" />
<Text className="text-[10px] font-medium text-warning">
Trending this week
</Text>
</View>
</View>
</Mount>
<Button
variant={following ? "secondary" : "default"}
size="sm"
haptic="light"
onPress={() => {
haptics.selection();
setFollowing((f) => !f);
}}
accessibilityLabel={following ? `Following #${tag}` : `Follow #${tag}`}
accessibilityState={{ checked: following }}
className="h-8 px-3"
>
{following ? "Following" : "Follow"}
</Button>
</View>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingBottom: insets.bottom + 24 }}
>
<Mount delay={60} className="flex-row flex-wrap px-1">
{posts.map((p) => (
<Press
key={p.id}
haptic="light"
onPress={() => onPostPress?.(p.id)}
accessibilityLabel={`Post by ${p.author}`}
className="w-1/3 p-1"
>
<Image
source={{ uri: p.uri }}
className="aspect-square w-full rounded-2xl bg-muted"
accessibilityLabel={`Photo by ${p.author}`}
/>
</Press>
))}
</Mount>
</ScrollView>
</SafeAreaView>
</World>
);
}
HashtagFeedScreen.displayName = "HashtagFeedScreen";
```
Screen: https://lumioui.dev/screens/social-hashtag-feed