v0.1 public beta early access on GitHub
Home / Screens / health-workout-detail
Screen template

Workout Detail Screen

Workout hero with exercise list and start

pro Expo Go ✓ iosandroid gestures: tap · scroll haptics: light · selection
$ npx lumioui add health-workout-detail
import { WorkoutDetailScreen } from "@/screens/health/workout-detail";
Registry dependencies6
Native packages installed6
@lumioui/ui@latest@lumioui/core@latestreact-native-safe-area-context@*react-native-reanimated@*react-native-svg@*nativewind@*
health/workout-detail.tsxsource · yours to edit
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, type IconName } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { GlowSpot, Mount, StickyBottomBar } from "../shared";

export interface ExerciseStep {
  id: string;
  name: string;
  detail: string;
  icon: IconName;
}

export interface WorkoutDetailScreenProps {
  name?: string;
  /** "8 exercises · 45 min · intermediate" */
  meta?: string;
  imageUrl?: string;
  exercises?: ExerciseStep[];
  onStart?: () => void;
  onBack?: () => void;
}

const DEFAULT_EXERCISES: ExerciseStep[] = [
  { id: "e1", name: "Warm-up flow", detail: "5 min · dynamic", icon: "clock" },
  { id: "e2", name: "Barbell row", detail: "4 × 10 · 40 kg", icon: "zap" },
  { id: "e3", name: "Overhead press", detail: "3 × 8 · 20 kg", icon: "arrow-up" },
  { id: "e4", name: "Pull-down", detail: "3 × 12 · 35 kg", icon: "arrow-down" },
  { id: "e5", name: "Core circuit", detail: "3 rounds · 90s", icon: "refresh" },
];

/** Workout detail — dark stage + lime accent, the fitness idiom: hero photo
 *  under a scrim, white type, numbered exercise rail, lime Start CTA. */
export function WorkoutDetailScreen({
  name = "Upper body strength",
  meta = "8 exercises · 45 min · Intermediate",
  imageUrl = "https://images.unsplash.com/photo-1517836357463-d25dfeac3438?w=800&h=500&fit=crop&q=70&auto=format",
  exercises = DEFAULT_EXERCISES,
  onStart,
  onBack,
}: WorkoutDetailScreenProps) {
  const haptics = useHaptic();
  const insets = useSafeAreaInsets();

  return (
    <SafeAreaView className="flex-1 bg-neutral-950" edges={["top"]}>
      <GlowSpot color="#A3E635" size={300} className="-top-16 right-[-80px]" />
      <GlowSpot color="#14B8A6" size={220} className="bottom-[30%] left-[-110px]" />
      <ScrollView
        showsVerticalScrollIndicator={false}
        contentContainerStyle={{ paddingBottom: insets.bottom + 96 }}
      >
        {/* Hero — photo bleeds to the top edge; chrome floats on the scrim. */}
        <View className="relative">
          <Image
            source={{ uri: imageUrl }}
            className="h-64 w-full"
            accessibilityLabel={`${name} hero`}
          />
          <View className="absolute inset-0 bg-black/45" accessibilityElementsHidden />
          <Glass interactive effect="clear" className="absolute left-4 top-2 rounded-full">
          <Button
            variant="ghost"
            size="icon"
            haptic="light"
            onPress={() => onBack?.()}
            accessibilityLabel="Go back"
            className="h-10 w-10 rounded-full"
          >
            <Icon name="chevron-left" size="md" color="#FFF" />
          </Button>
          </Glass>
          <View className="absolute bottom-4 left-4 right-4">
            <Text className="text-[11px] font-semibold uppercase tracking-[1.6px] text-[#A3E635]">
              Strength · Today
            </Text>
            <Text className="mt-1 text-3xl font-bold tracking-tight text-white">{name}</Text>
            <Text className="mt-0.5 text-sm text-white/60">{meta}</Text>
            {/* Burn estimate — the stat workout cards always promise. */}
            <View className="mt-2 flex-row items-center gap-1.5">
              <Icon name="flame" size="sm" color="#A3E635" />
              <Text className="text-xs font-medium text-[#A3E635]">
                Burns ~420 kcal · you'll need dumbbells
              </Text>
            </View>
          </View>
        </View>

        {/* Exercises — numbered rail on glass-dark cards. */}
        <View className="mt-6">
          <View className="flex-row items-center justify-between px-4 pb-2.5">
            <Text className="text-xs font-medium uppercase tracking-wide text-white/40">
              Exercises
            </Text>
            <Text className="text-xs font-semibold text-[#A3E635]">
              {exercises.length} moves
            </Text>
          </View>
          <View className="mx-4 gap-2">
            {exercises.map((e, ii) => (
              <Mount key={e.id} delay={100 + ii * 60}>
                <View className="flex-row items-center gap-3.5 rounded-2xl bg-white/[0.06] px-4 py-3.5">
                  <Text className="w-6 text-center text-sm font-semibold text-[#A3E635]">
                    {String(ii + 1).padStart(2, "0")}
                  </Text>
                  <View className="flex-1">
                    <Text className="text-sm font-medium text-white">{e.name}</Text>
                    <Text className="text-xs text-white/50">{e.detail}</Text>
                  </View>
                  <Icon name={e.icon} size="sm" color="#A3E635" />
                </View>
              </Mount>
            ))}
          </View>
        </View>
      </ScrollView>

      <StickyBottomBar className="bg-neutral-950/95 border-white/10">
        <Button
          haptic="light"
          onPress={() => {
            haptics.medium();
            onStart?.();
          }}
          accessibilityLabel={`Start ${name}`}
          className="w-full bg-[#A3E635]"
          textClassName="text-neutral-950 font-bold"
        >
          Start workout
        </Button>
      </StickyBottomBar>
    </SafeAreaView>
  );
}
WorkoutDetailScreen.displayName = "WorkoutDetailScreen";
agent prompt — paste into Claude Code, Cursor, Devin…
Recreate the "Workout Detail Screen" screen in React Native using LumioUI.

Goal: Workout hero with exercise list and start 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 health-workout-detail
```

Or pull just the components: `npx lumioui add button glass 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.
- `<Button>` ×2

### `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>` ×1

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

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

### `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>` ×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/health/workout-detail.tsx` exporting WorkoutDetailScreen. 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, type IconName } from "@lumioui/ui";
import { useHaptic } from "@lumioui/core";
import { GlowSpot, Mount, StickyBottomBar } from "../shared";

export interface ExerciseStep {
  id: string;
  name: string;
  detail: string;
  icon: IconName;
}

export interface WorkoutDetailScreenProps {
  name?: string;
  /** "8 exercises · 45 min · intermediate" */
  meta?: string;
  imageUrl?: string;
  exercises?: ExerciseStep[];
  onStart?: () => void;
  onBack?: () => void;
}

const DEFAULT_EXERCISES: ExerciseStep[] = [
  { id: "e1", name: "Warm-up flow", detail: "5 min · dynamic", icon: "clock" },
  { id: "e2", name: "Barbell row", detail: "4 × 10 · 40 kg", icon: "zap" },
  { id: "e3", name: "Overhead press", detail: "3 × 8 · 20 kg", icon: "arrow-up" },
  { id: "e4", name: "Pull-down", detail: "3 × 12 · 35 kg", icon: "arrow-down" },
  { id: "e5", name: "Core circuit", detail: "3 rounds · 90s", icon: "refresh" },
];

/** Workout detail — dark stage + lime accent, the fitness idiom: hero photo
 *  under a scrim, white type, numbered exercise rail, lime Start CTA. */
export function WorkoutDetailScreen({
  name = "Upper body strength",
  meta = "8 exercises · 45 min · Intermediate",
  imageUrl = "https://images.unsplash.com/photo-1517836357463-d25dfeac3438?w=800&h=500&fit=crop&q=70&auto=format",
  exercises = DEFAULT_EXERCISES,
  onStart,
  onBack,
}: WorkoutDetailScreenProps) {
  const haptics = useHaptic();
  const insets = useSafeAreaInsets();

  return (
    <SafeAreaView className="flex-1 bg-neutral-950" edges={["top"]}>
      <GlowSpot color="#A3E635" size={300} className="-top-16 right-[-80px]" />
      <GlowSpot color="#14B8A6" size={220} className="bottom-[30%] left-[-110px]" />
      <ScrollView
        showsVerticalScrollIndicator={false}
        contentContainerStyle={{ paddingBottom: insets.bottom + 96 }}
      >
        {/* Hero — photo bleeds to the top edge; chrome floats on the scrim. */}
        <View className="relative">
          <Image
            source={{ uri: imageUrl }}
            className="h-64 w-full"
            accessibilityLabel={`${name} hero`}
          />
          <View className="absolute inset-0 bg-black/45" accessibilityElementsHidden />
          <Glass interactive effect="clear" className="absolute left-4 top-2 rounded-full">
          <Button
            variant="ghost"
            size="icon"
            haptic="light"
            onPress={() => onBack?.()}
            accessibilityLabel="Go back"
            className="h-10 w-10 rounded-full"
          >
            <Icon name="chevron-left" size="md" color="#FFF" />
          </Button>
          </Glass>
          <View className="absolute bottom-4 left-4 right-4">
            <Text className="text-[11px] font-semibold uppercase tracking-[1.6px] text-[#A3E635]">
              Strength · Today
            </Text>
            <Text className="mt-1 text-3xl font-bold tracking-tight text-white">{name}</Text>
            <Text className="mt-0.5 text-sm text-white/60">{meta}</Text>
            {/* Burn estimate — the stat workout cards always promise. */}
            <View className="mt-2 flex-row items-center gap-1.5">
              <Icon name="flame" size="sm" color="#A3E635" />
              <Text className="text-xs font-medium text-[#A3E635]">
                Burns ~420 kcal · you'll need dumbbells
              </Text>
            </View>
          </View>
        </View>

        {/* Exercises — numbered rail on glass-dark cards. */}
        <View className="mt-6">
          <View className="flex-row items-center justify-between px-4 pb-2.5">
            <Text className="text-xs font-medium uppercase tracking-wide text-white/40">
              Exercises
            </Text>
            <Text className="text-xs font-semibold text-[#A3E635]">
              {exercises.length} moves
            </Text>
          </View>
          <View className="mx-4 gap-2">
            {exercises.map((e, ii) => (
              <Mount key={e.id} delay={100 + ii * 60}>
                <View className="flex-row items-center gap-3.5 rounded-2xl bg-white/[0.06] px-4 py-3.5">
                  <Text className="w-6 text-center text-sm font-semibold text-[#A3E635]">
                    {String(ii + 1).padStart(2, "0")}
                  </Text>
                  <View className="flex-1">
                    <Text className="text-sm font-medium text-white">{e.name}</Text>
                    <Text className="text-xs text-white/50">{e.detail}</Text>
                  </View>
                  <Icon name={e.icon} size="sm" color="#A3E635" />
                </View>
              </Mount>
            ))}
          </View>
        </View>
      </ScrollView>

      <StickyBottomBar className="bg-neutral-950/95 border-white/10">
        <Button
          haptic="light"
          onPress={() => {
            haptics.medium();
            onStart?.();
          }}
          accessibilityLabel={`Start ${name}`}
          className="w-full bg-[#A3E635]"
          textClassName="text-neutral-950 font-bold"
        >
          Start workout
        </Button>
      </StickyBottomBar>
    </SafeAreaView>
  );
}
WorkoutDetailScreen.displayName = "WorkoutDetailScreen";
```

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