v0.1 public beta early access on GitHub
Home / Screens / social-post-hero
Screen template

Post Hero

Full-bleed hero post: photo fills the page, floating chrome over gradient scrims, live like/save/follow

pro Expo Go ✓ iosandroid gestures: tap haptics: selection
$ npx lumioui add social-post-hero
import { PostHeroScreen } from "@/screens/social/post-hero";
Registry dependencies5
Native packages installed6
@lumioui/ui@latest@lumioui/core@latestreact-native-safe-area-context@*react-native-reanimated@*react-native-svg@*nativewind@*
social/post-hero.tsxsource · yours to edit
import * as React from "react";
import { useState } from "react";
import { View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { Avatar, Glass, Icon, Image, Text } from "@lumioui/ui";
import { cn, useHaptic } from "@lumioui/core";
import { GlowSpot, Mount, Press, StoryChrome, StoryScrim, World } from "../shared";

export interface PostHeroScreenProps {
  author?: string;
  handle?: string;
  avatarUrl?: string;
  photoUrl?: string;
  caption?: string;
  location?: string;
  likes?: number;
  comments?: number;
  onProfile?: () => void;
  onBack?: () => void;
}

/** Full-bleed hero post — VSCO/editorial idiom: the photo IS the page,
 *  chrome floats on top and bottom over real gradient scrims. Like, save,
 *  and follow all toggle live. */
export function PostHeroScreen({
  author = "Maya Chen",
  handle = "@maya.frames",
  avatarUrl = "https://i.pravatar.cc/150?img=32",
  photoUrl = "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=900&h=1600&fit=crop&q=80&auto=format",
  caption = "Morning inversion burning off the valley — three minutes before the fog took it all back.",
  location = "Point Reyes, California",
  likes = 4211,
  comments = 87,
  onProfile,
  onBack,
}: PostHeroScreenProps) {
  const haptics = useHaptic();
  const [liked, setLiked] = useState(false);
  const [saved, setSaved] = useState(false);
  const [following, setFollowing] = useState(false);
  const likeCount = (likes + (liked ? 1 : 0)).toLocaleString();

  return (
    <World primary="#65A30D">
    <View className={cn("flex-1", StoryChrome.surface)}>
      <Image
        source={{ uri: photoUrl }}
        className="absolute bottom-0 left-0 right-0 top-0 h-full w-full"
        accessibilityLabel={`Photo by ${author}`}
      />
      <View className="absolute left-0 right-0 top-0 h-40">
        <StoryScrim edge="top" />
      </View>
      <View className="absolute bottom-0 left-0 right-0 h-56">
        <StoryScrim edge="bottom" />
      </View>

      <SafeAreaView className="flex-1 justify-between" edges={["top", "bottom"]}>
      <GlowSpot color="#BEF04C" size={300} className="-top-20 right-[-80px] opacity-30" />
      <GlowSpot color="#BEF04C" size={220} className="bottom-[30%] left-[-100px] opacity-30" />
        {/* Top chrome — author + follow, floating over the scrim. */}
        <Mount className="flex-row items-center gap-3 px-5 pt-2">
          {/* Liquid-glass back disc — iOS 26 chrome over the photo. */}
          <Glass interactive effect="clear"  className="rounded-full">
            <Press
              onPress={onBack}
              hitSlop={12}
              accessibilityRole="button"
              accessibilityLabel="Back"
              className="h-10 w-10 items-center justify-center"
            >
              <Icon name="chevron-left" size="md" color={StoryChrome.icon} />
            </Press>
          </Glass>
          <Press
            onPress={onProfile}
            pressedScale={0.97}
            accessibilityRole="button"
            accessibilityLabel={`View ${author}'s profile`}
            className="flex-1 flex-row items-center gap-3"
          >
            <Avatar size="sm" source={{ uri: avatarUrl }} fallback={author} alt={author} />
            <View>
              <Text variant="large" className={StoryChrome.text}>
                {author}
              </Text>
              <Text variant="small" className={StoryChrome.textDim}>
                {location}
              </Text>
            </View>
          </Press>
          {following ? (
            <Press
              onPress={() => {
                haptics.selection();
                setFollowing(false);
              }}
              accessibilityRole="button"
              accessibilityState={{ selected: true }}
              accessibilityLabel="Following"
              className="h-9 items-center justify-center rounded-full bg-white px-4"
            >
              <Text variant="small" className="font-medium text-black">
                Following
              </Text>
            </Press>
          ) : (
            <Glass interactive
              effect="clear"
              
              className={cn("rounded-full", StoryChrome.pill)}
            >
              <Press
                onPress={() => {
                  haptics.selection();
                  setFollowing(true);
                }}
                accessibilityRole="button"
                accessibilityLabel="Follow"
                className="h-9 items-center justify-center px-4"
              >
                <Text variant="small" className={cn("font-medium", StoryChrome.text)}>
                  Follow
                </Text>
              </Press>
            </Glass>
          )}
        </Mount>

        {/* Bottom chrome — caption + action row. */}
        <Mount delay={60} className="gap-4 px-5 pb-3">
          <Text className={StoryChrome.text} numberOfLines={3}>
            <Text className={cn("font-semibold", StoryChrome.text)}>{handle} </Text>
            {caption}
          </Text>
          {/* Film-line — editorial photo pages credit the craft. */}
          <Text className={cn("text-[11px] tracking-[0.14em]", StoryChrome.text, "opacity-70")}>
            SHOT ON 35MM · PORTRA 400
          </Text>
          <View className="flex-row items-center gap-6">
            <Press
              onPress={() => {
                haptics.selection();
                setLiked((l) => !l);
              }}
              hitSlop={10}
              accessibilityRole="button"
              accessibilityState={{ checked: liked }}
              accessibilityLabel={liked ? "Unlike" : "Like"}
              className="flex-row items-center gap-2"
            >
              <Icon
                name="heart"
                size="lg"
                color={liked ? "#F87171" : StoryChrome.icon}
                filled={liked}
              />
              <Text variant="large" className={StoryChrome.text}>
                {likeCount}
              </Text>
            </Press>
            <Press
              hitSlop={10}
              accessibilityRole="button"
              accessibilityLabel={`${comments} comments`}
              className="flex-row items-center gap-2"
            >
              <Icon name="message-circle" size="lg" color={StoryChrome.icon} />
              <Text variant="large" className={StoryChrome.text}>
                {comments}
              </Text>
            </Press>
            <Press
              hitSlop={10}
              accessibilityRole="button"
              accessibilityLabel="Share"
              className="flex-row items-center"
            >
              <Icon name="send" size="lg" color={StoryChrome.icon} />
            </Press>
            <Press
              onPress={() => {
                haptics.selection();
                setSaved((s) => !s);
              }}
              hitSlop={10}
              accessibilityRole="button"
              accessibilityState={{ checked: saved }}
              accessibilityLabel={saved ? "Saved" : "Save"}
              className="ml-auto"
            >
              <Icon
                name="bookmark"
                size="lg"
                color={StoryChrome.icon}
                filled={saved}
              />
            </Press>
          </View>
        </Mount>
      </SafeAreaView>
    </View>
    </World>
  );
}
PostHeroScreen.displayName = "PostHeroScreen";
agent prompt — paste into Claude Code, Cursor, Devin…
Recreate the "Post Hero" screen in React Native using LumioUI.

Goal: Full-bleed hero post: photo fills the page, floating chrome over gradient scrims, live like/save/follow 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-post-hero
```

Or pull just the components: `npx lumioui add avatar 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

### `avatar` — Circular user image with fallback initials and status dot.
- `<Avatar>` ×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>` ×2 — Liquid-glass back disc — iOS 26 chrome over the photo.

### `icon` — Lucide icon set mapped to theme colors and sizes.
- `<Icon>` ×5

### `image` — Cached image with placeholder, fallback and aspect handling.
- `<Image>` ×1

### `text` — Themed type scale from caption to display.
- `<Text>` ×9

## 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/post-hero.tsx` exporting PostHeroScreen. 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 { useState } from "react";
import { View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { Avatar, Glass, Icon, Image, Text } from "@lumioui/ui";
import { cn, useHaptic } from "@lumioui/core";
import { GlowSpot, Mount, Press, StoryChrome, StoryScrim, World } from "../shared";

export interface PostHeroScreenProps {
  author?: string;
  handle?: string;
  avatarUrl?: string;
  photoUrl?: string;
  caption?: string;
  location?: string;
  likes?: number;
  comments?: number;
  onProfile?: () => void;
  onBack?: () => void;
}

/** Full-bleed hero post — VSCO/editorial idiom: the photo IS the page,
 *  chrome floats on top and bottom over real gradient scrims. Like, save,
 *  and follow all toggle live. */
export function PostHeroScreen({
  author = "Maya Chen",
  handle = "@maya.frames",
  avatarUrl = "https://i.pravatar.cc/150?img=32",
  photoUrl = "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=900&h=1600&fit=crop&q=80&auto=format",
  caption = "Morning inversion burning off the valley — three minutes before the fog took it all back.",
  location = "Point Reyes, California",
  likes = 4211,
  comments = 87,
  onProfile,
  onBack,
}: PostHeroScreenProps) {
  const haptics = useHaptic();
  const [liked, setLiked] = useState(false);
  const [saved, setSaved] = useState(false);
  const [following, setFollowing] = useState(false);
  const likeCount = (likes + (liked ? 1 : 0)).toLocaleString();

  return (
    <World primary="#65A30D">
    <View className={cn("flex-1", StoryChrome.surface)}>
      <Image
        source={{ uri: photoUrl }}
        className="absolute bottom-0 left-0 right-0 top-0 h-full w-full"
        accessibilityLabel={`Photo by ${author}`}
      />
      <View className="absolute left-0 right-0 top-0 h-40">
        <StoryScrim edge="top" />
      </View>
      <View className="absolute bottom-0 left-0 right-0 h-56">
        <StoryScrim edge="bottom" />
      </View>

      <SafeAreaView className="flex-1 justify-between" edges={["top", "bottom"]}>
      <GlowSpot color="#BEF04C" size={300} className="-top-20 right-[-80px] opacity-30" />
      <GlowSpot color="#BEF04C" size={220} className="bottom-[30%] left-[-100px] opacity-30" />
        {/* Top chrome — author + follow, floating over the scrim. */}
        <Mount className="flex-row items-center gap-3 px-5 pt-2">
          {/* Liquid-glass back disc — iOS 26 chrome over the photo. */}
          <Glass interactive effect="clear"  className="rounded-full">
            <Press
              onPress={onBack}
              hitSlop={12}
              accessibilityRole="button"
              accessibilityLabel="Back"
              className="h-10 w-10 items-center justify-center"
            >
              <Icon name="chevron-left" size="md" color={StoryChrome.icon} />
            </Press>
          </Glass>
          <Press
            onPress={onProfile}
            pressedScale={0.97}
            accessibilityRole="button"
            accessibilityLabel={`View ${author}'s profile`}
            className="flex-1 flex-row items-center gap-3"
          >
            <Avatar size="sm" source={{ uri: avatarUrl }} fallback={author} alt={author} />
            <View>
              <Text variant="large" className={StoryChrome.text}>
                {author}
              </Text>
              <Text variant="small" className={StoryChrome.textDim}>
                {location}
              </Text>
            </View>
          </Press>
          {following ? (
            <Press
              onPress={() => {
                haptics.selection();
                setFollowing(false);
              }}
              accessibilityRole="button"
              accessibilityState={{ selected: true }}
              accessibilityLabel="Following"
              className="h-9 items-center justify-center rounded-full bg-white px-4"
            >
              <Text variant="small" className="font-medium text-black">
                Following
              </Text>
            </Press>
          ) : (
            <Glass interactive
              effect="clear"
              
              className={cn("rounded-full", StoryChrome.pill)}
            >
              <Press
                onPress={() => {
                  haptics.selection();
                  setFollowing(true);
                }}
                accessibilityRole="button"
                accessibilityLabel="Follow"
                className="h-9 items-center justify-center px-4"
              >
                <Text variant="small" className={cn("font-medium", StoryChrome.text)}>
                  Follow
                </Text>
              </Press>
            </Glass>
          )}
        </Mount>

        {/* Bottom chrome — caption + action row. */}
        <Mount delay={60} className="gap-4 px-5 pb-3">
          <Text className={StoryChrome.text} numberOfLines={3}>
            <Text className={cn("font-semibold", StoryChrome.text)}>{handle} </Text>
            {caption}
          </Text>
          {/* Film-line — editorial photo pages credit the craft. */}
          <Text className={cn("text-[11px] tracking-[0.14em]", StoryChrome.text, "opacity-70")}>
            SHOT ON 35MM · PORTRA 400
          </Text>
          <View className="flex-row items-center gap-6">
            <Press
              onPress={() => {
                haptics.selection();
                setLiked((l) => !l);
              }}
              hitSlop={10}
              accessibilityRole="button"
              accessibilityState={{ checked: liked }}
              accessibilityLabel={liked ? "Unlike" : "Like"}
              className="flex-row items-center gap-2"
            >
              <Icon
                name="heart"
                size="lg"
                color={liked ? "#F87171" : StoryChrome.icon}
                filled={liked}
              />
              <Text variant="large" className={StoryChrome.text}>
                {likeCount}
              </Text>
            </Press>
            <Press
              hitSlop={10}
              accessibilityRole="button"
              accessibilityLabel={`${comments} comments`}
              className="flex-row items-center gap-2"
            >
              <Icon name="message-circle" size="lg" color={StoryChrome.icon} />
              <Text variant="large" className={StoryChrome.text}>
                {comments}
              </Text>
            </Press>
            <Press
              hitSlop={10}
              accessibilityRole="button"
              accessibilityLabel="Share"
              className="flex-row items-center"
            >
              <Icon name="send" size="lg" color={StoryChrome.icon} />
            </Press>
            <Press
              onPress={() => {
                haptics.selection();
                setSaved((s) => !s);
              }}
              hitSlop={10}
              accessibilityRole="button"
              accessibilityState={{ checked: saved }}
              accessibilityLabel={saved ? "Saved" : "Save"}
              className="ml-auto"
            >
              <Icon
                name="bookmark"
                size="lg"
                color={StoryChrome.icon}
                filled={saved}
              />
            </Press>
          </View>
        </Mount>
      </SafeAreaView>
    </View>
    </World>
  );
}
PostHeroScreen.displayName = "PostHeroScreen";
```

Screen: https://lumioui.dev/screens/social-post-hero
iPhone 17 · iOS
9:41
Live preview — the real screen via Expo Web · open full ↗