v0.1 public beta early access on GitHub
Home / Screens / core-report-issue
Screen template

Report issue Screen

Reason chips, context card, details field, and submit.

pro Expo Go ✓ iosandroid gestures: tap · scroll haptics: light · selection
$ npx lumioui add core-report-issue
import { ReportIssueScreen } from "@/screens/core/report-issue";
Native packages installed6
@lumioui/ui@latest@lumioui/core@latestreact-native-safe-area-context@*react-native-reanimated@*react-native-svg@*nativewind@*
core/report-issue.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 { Avatar, Button, Glass, Icon, List, Switch, Text, Textarea, type IconName, } from "@lumioui/ui";
import { AnimatedPressable, cn, useHaptic } from "@lumioui/core";
import { Mount, Press, RowIcon, StickyBottomBar } from "../shared";

export interface ReportedUser {
  name: string;
  handle: string;
  avatarUrl?: string;
}

export interface ReportIssueScreenProps {
  /** When reporting a person, pass them — the header card shows who's being reported. */
  user?: ReportedUser;
  reasons?: string[];
  onSubmit?: (reason: string, details: string) => void;
  onBack?: () => void;
}

const DEFAULT_REASONS = [
  "Spam or scam",
  "Harassment",
  "Hate speech",
  "Inappropriate content",
  "Impersonation",
  "Something else",
];

/** Report issue — reason selection with context card and details field. */
export function ReportIssueScreen({
  user = { name: "Jordan Blake", handle: "@jblake", avatarUrl: "https://i.pravatar.cc/150?img=12" },
  reasons = DEFAULT_REASONS,
  onSubmit,
  onBack,
}: ReportIssueScreenProps) {
  const haptics = useHaptic();
  const insets = useSafeAreaInsets();
  const [reason, setReason] = React.useState<string | undefined>(
    "Spam or scam",
  );
  const [details, setDetails] = React.useState("");
  const [alsoBlock, setAlsoBlock] = React.useState(false);

  return (
    <SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
      {/* Floating chrome — back disc + centered title pill. */}
      <View className="absolute inset-x-4 z-10" style={{ top: insets.top + 8 }} pointerEvents="box-none">
        <View className="flex-row items-center 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>
        </View>
        <View pointerEvents="none" className="absolute inset-0 items-center justify-center">
          <Glass
            effect="regular"
            className="h-11 flex-row items-center justify-center rounded-full px-5"
          >
            <Text accessibilityRole="header" className="text-sm font-bold tracking-tight">
              Report
            </Text>
          </Glass>
        </View>
      </View>

      <ScrollView
        showsVerticalScrollIndicator={false}
        keyboardShouldPersistTaps="handled"
        contentContainerStyle={{ paddingTop: insets.top + 60, paddingBottom: insets.bottom + 120 }}
      >
        {user && (
          <List inset>
            <List.Section>
              <List.Item
                title={user.name}
                subtitle={`${user.handle} · Member since 2023`}
                leading={
                  <Avatar
                    size="md"
                    source={user.avatarUrl ? { uri: user.avatarUrl } : undefined}
                    fallback={user.name}
                    alt={user.name}
                  />
                }
                className="py-3"
              />
            </List.Section>
          </List>
        )}

        {/* Quoted context — what they're flagging, so the report isn't
            abstract. */}
        {user && (
          <View className="mx-4 mt-4 overflow-hidden rounded-2xl bg-white p-4 dark:bg-[#1A1A20]">
            <Text variant="small" className="pb-1 text-xs text-muted-foreground">
              Reported post · 2h ago
            </Text>
            <Text className="text-sm leading-relaxed" numberOfLines={3}>
              "DM me for the wholesale link — designer bags 70% off, shipping
              worldwide, no customs fees 🤝"
            </Text>
          </View>
        )}

        {/* Reason picker — full-width rows like IG's report flow: icon left,
            label, radio-style check on the selected row. */}
        <Mount className="mx-4 mt-4 gap-4 overflow-hidden rounded-3xl bg-white p-4 dark:bg-[#1A1A20]">
          <View className="gap-1">
            <Text variant="small" className="pb-2 text-muted-foreground">
              What's the issue?
            </Text>
            {reasons.map((r) => {
              const selected = reason === r;
              const icons: Record<string, IconName> = {
                "Spam or scam": "alert-triangle",
                Harassment: "message-circle",
                "Hate speech": "x",
                "Inappropriate content": "eye-off",
                Impersonation: "users",
              };
              return (
                <AnimatedPressable
                  key={r}
                  onPress={() => {
                    haptics.selection();
                    setReason(r);
                  }}
                  accessibilityRole="button"
                  accessibilityState={{ selected }}
                  className={cn(
                    "flex-row items-center gap-3 rounded-2xl px-3 py-3",
                    selected && "bg-[#EDF8C4] dark:bg-[#1E2410]",
                  )}
                >
                  <Icon
                    name={(icons[r] ?? "flag") as IconName}
                    size="sm"
                    color={selected ? "#65A30D" : "mutedForeground"}
                  />
                  <Text
                    className={cn(
                      "flex-1 text-sm",
                      selected ? "font-semibold text-[#365314] dark:text-[#BEF04C]" : "text-foreground",
                    )}
                  >
                    {r}
                  </Text>
                  <View
                    className={cn(
                      "h-5 w-5 items-center justify-center rounded-full border-2",
                      selected ? "border-[#BEF04C] bg-[#BEF04C]" : "border-muted-foreground/40",
                    )}
                  >
                    {selected && <Icon name="check" size="sm" color="#1B1B26" />}
                  </View>
                </AnimatedPressable>
              );
            })}
          </View>

          <View className="gap-2">
            <Text variant="small" className="text-muted-foreground">
              Anything else we should know? (optional)
            </Text>
            <Textarea
              value={details}
              onChangeText={setDetails}
              placeholder="Links, timestamps, or context that helps the review team…"
              minHeight={110}
              accessibilityLabel="Report details"
            />
            <Text variant="small" className="text-muted-foreground">
              Reports are confidential — the person won't be told who reported them.
            </Text>
          </View>

          {user && (
            <View className="flex-row items-center gap-3 border-t border-border pt-4">
              <Text className="flex-1 text-sm font-medium">
                Also block {user.handle}
              </Text>
              <Switch
                checked={alsoBlock}
                onCheckedChange={(v) => {
                  haptics.selection();
                  setAlsoBlock(v);
                }}
                accessibilityLabel={`Also block ${user.handle}`}
              />
            </View>
          )}
        </Mount>

        {/* Reassurance — the SLA is what makes a report feel worthwhile. */}
        <Mount delay={60} className="mx-4 mt-4 flex-row items-center gap-3 rounded-2xl bg-white p-4 dark:bg-[#1A1A20]">
          <RowIcon name="shield" tone="green" />
          <Text variant="small" className="flex-1 text-muted-foreground">
            We review reports within 24 hours. You'll hear from us either way.
          </Text>
        </Mount>
      </ScrollView>

      <StickyBottomBar>
        <Button
          className="w-full bg-[#1B1B26]"
          textClassName="text-white"
          haptic="medium"
          onPress={() => {
            haptics.warning();
            onSubmit?.(reason ?? "Something else", details);
          }}
          disabled={!reason}
          accessibilityLabel="Submit report"
        >
          Submit report
        </Button>
      </StickyBottomBar>
    </SafeAreaView>
  );
}
ReportIssueScreen.displayName = "ReportIssueScreen";
agent prompt — paste into Claude Code, Cursor, Devin…
Recreate the "Report issue Screen" screen in React Native using LumioUI.

Goal: Reason chips, context card, details field, and submit. 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 core-report-issue
```

Or pull just the components: `npx lumioui add avatar button chip icon list switch text textarea`

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

### `button` — Tactile pill button with press spring, ink wash and async loading.
- `<Button>` ×1

### `chip` — Compact selectable pill with press scale and ink overlay.
- 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>` ×3

### `list` — Settings-style rows with separators and press feedback.
- `<List>` ×1

### `switch` — iOS-size toggle with spring thumb and haptics.
- `<Switch>` ×1

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

### `textarea` — Multiline field with auto-grow and character count.
- `<Textarea>` ×1

## 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/core/report-issue.tsx` exporting ReportIssueScreen. 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 { Avatar, Button, Glass, Icon, List, Switch, Text, Textarea, type IconName, } from "@lumioui/ui";
import { AnimatedPressable, cn, useHaptic } from "@lumioui/core";
import { Mount, Press, RowIcon, StickyBottomBar } from "../shared";

export interface ReportedUser {
  name: string;
  handle: string;
  avatarUrl?: string;
}

export interface ReportIssueScreenProps {
  /** When reporting a person, pass them — the header card shows who's being reported. */
  user?: ReportedUser;
  reasons?: string[];
  onSubmit?: (reason: string, details: string) => void;
  onBack?: () => void;
}

const DEFAULT_REASONS = [
  "Spam or scam",
  "Harassment",
  "Hate speech",
  "Inappropriate content",
  "Impersonation",
  "Something else",
];

/** Report issue — reason selection with context card and details field. */
export function ReportIssueScreen({
  user = { name: "Jordan Blake", handle: "@jblake", avatarUrl: "https://i.pravatar.cc/150?img=12" },
  reasons = DEFAULT_REASONS,
  onSubmit,
  onBack,
}: ReportIssueScreenProps) {
  const haptics = useHaptic();
  const insets = useSafeAreaInsets();
  const [reason, setReason] = React.useState<string | undefined>(
    "Spam or scam",
  );
  const [details, setDetails] = React.useState("");
  const [alsoBlock, setAlsoBlock] = React.useState(false);

  return (
    <SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
      {/* Floating chrome — back disc + centered title pill. */}
      <View className="absolute inset-x-4 z-10" style={{ top: insets.top + 8 }} pointerEvents="box-none">
        <View className="flex-row items-center 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>
        </View>
        <View pointerEvents="none" className="absolute inset-0 items-center justify-center">
          <Glass
            effect="regular"
            className="h-11 flex-row items-center justify-center rounded-full px-5"
          >
            <Text accessibilityRole="header" className="text-sm font-bold tracking-tight">
              Report
            </Text>
          </Glass>
        </View>
      </View>

      <ScrollView
        showsVerticalScrollIndicator={false}
        keyboardShouldPersistTaps="handled"
        contentContainerStyle={{ paddingTop: insets.top + 60, paddingBottom: insets.bottom + 120 }}
      >
        {user && (
          <List inset>
            <List.Section>
              <List.Item
                title={user.name}
                subtitle={`${user.handle} · Member since 2023`}
                leading={
                  <Avatar
                    size="md"
                    source={user.avatarUrl ? { uri: user.avatarUrl } : undefined}
                    fallback={user.name}
                    alt={user.name}
                  />
                }
                className="py-3"
              />
            </List.Section>
          </List>
        )}

        {/* Quoted context — what they're flagging, so the report isn't
            abstract. */}
        {user && (
          <View className="mx-4 mt-4 overflow-hidden rounded-2xl bg-white p-4 dark:bg-[#1A1A20]">
            <Text variant="small" className="pb-1 text-xs text-muted-foreground">
              Reported post · 2h ago
            </Text>
            <Text className="text-sm leading-relaxed" numberOfLines={3}>
              "DM me for the wholesale link — designer bags 70% off, shipping
              worldwide, no customs fees 🤝"
            </Text>
          </View>
        )}

        {/* Reason picker — full-width rows like IG's report flow: icon left,
            label, radio-style check on the selected row. */}
        <Mount className="mx-4 mt-4 gap-4 overflow-hidden rounded-3xl bg-white p-4 dark:bg-[#1A1A20]">
          <View className="gap-1">
            <Text variant="small" className="pb-2 text-muted-foreground">
              What's the issue?
            </Text>
            {reasons.map((r) => {
              const selected = reason === r;
              const icons: Record<string, IconName> = {
                "Spam or scam": "alert-triangle",
                Harassment: "message-circle",
                "Hate speech": "x",
                "Inappropriate content": "eye-off",
                Impersonation: "users",
              };
              return (
                <AnimatedPressable
                  key={r}
                  onPress={() => {
                    haptics.selection();
                    setReason(r);
                  }}
                  accessibilityRole="button"
                  accessibilityState={{ selected }}
                  className={cn(
                    "flex-row items-center gap-3 rounded-2xl px-3 py-3",
                    selected && "bg-[#EDF8C4] dark:bg-[#1E2410]",
                  )}
                >
                  <Icon
                    name={(icons[r] ?? "flag") as IconName}
                    size="sm"
                    color={selected ? "#65A30D" : "mutedForeground"}
                  />
                  <Text
                    className={cn(
                      "flex-1 text-sm",
                      selected ? "font-semibold text-[#365314] dark:text-[#BEF04C]" : "text-foreground",
                    )}
                  >
                    {r}
                  </Text>
                  <View
                    className={cn(
                      "h-5 w-5 items-center justify-center rounded-full border-2",
                      selected ? "border-[#BEF04C] bg-[#BEF04C]" : "border-muted-foreground/40",
                    )}
                  >
                    {selected && <Icon name="check" size="sm" color="#1B1B26" />}
                  </View>
                </AnimatedPressable>
              );
            })}
          </View>

          <View className="gap-2">
            <Text variant="small" className="text-muted-foreground">
              Anything else we should know? (optional)
            </Text>
            <Textarea
              value={details}
              onChangeText={setDetails}
              placeholder="Links, timestamps, or context that helps the review team…"
              minHeight={110}
              accessibilityLabel="Report details"
            />
            <Text variant="small" className="text-muted-foreground">
              Reports are confidential — the person won't be told who reported them.
            </Text>
          </View>

          {user && (
            <View className="flex-row items-center gap-3 border-t border-border pt-4">
              <Text className="flex-1 text-sm font-medium">
                Also block {user.handle}
              </Text>
              <Switch
                checked={alsoBlock}
                onCheckedChange={(v) => {
                  haptics.selection();
                  setAlsoBlock(v);
                }}
                accessibilityLabel={`Also block ${user.handle}`}
              />
            </View>
          )}
        </Mount>

        {/* Reassurance — the SLA is what makes a report feel worthwhile. */}
        <Mount delay={60} className="mx-4 mt-4 flex-row items-center gap-3 rounded-2xl bg-white p-4 dark:bg-[#1A1A20]">
          <RowIcon name="shield" tone="green" />
          <Text variant="small" className="flex-1 text-muted-foreground">
            We review reports within 24 hours. You'll hear from us either way.
          </Text>
        </Mount>
      </ScrollView>

      <StickyBottomBar>
        <Button
          className="w-full bg-[#1B1B26]"
          textClassName="text-white"
          haptic="medium"
          onPress={() => {
            haptics.warning();
            onSubmit?.(reason ?? "Something else", details);
          }}
          disabled={!reason}
          accessibilityLabel="Submit report"
        >
          Submit report
        </Button>
      </StickyBottomBar>
    </SafeAreaView>
  );
}
ReportIssueScreen.displayName = "ReportIssueScreen";
```

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