v0.1 public beta early access on GitHub
Home / Screens / misc-standings
Screen template

Standings Screen

League table with trends

pro Expo Go ✓ iosandroid gestures: tap · scroll haptics: light · selection
$ npx lumioui add misc-standings
import { StandingsScreen } from "@/screens/misc/standings";
Registry dependencies4
Native packages installed6
@lumioui/ui@latestreact-native-safe-area-context@*@lumioui/core@latestreact-native-reanimated@*react-native-svg@*nativewind@*
misc/standings.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 { Glass, Icon, List, Text, type IconName } from "@lumioui/ui";
import { LumioMark, MONO, Mount, Press, World } from "../shared";

export interface Standing {
  id: string;
  team: string;
  abbr: string;
  played: number;
  points: number;
  trend?: "up" | "down" | "same";
  /** Last-5 results, oldest → newest. */
  form?: ("W" | "D" | "L")[];
}

export interface StandingsScreenProps {
  league?: string;
  standings?: Standing[];
  onBack?: () => void;
}

const DEFAULT_STANDINGS: Standing[] = [
  { id: "s1", team: "Arsenal", abbr: "ARS", played: 8, points: 20, trend: "up", form: ["W", "W", "D", "W", "W"] },
  { id: "s2", team: "Man City", abbr: "MCI", played: 8, points: 19, trend: "down", form: ["W", "L", "W", "D", "W"] },
  { id: "s3", team: "Liverpool", abbr: "LIV", played: 8, points: 18, trend: "up", form: ["D", "W", "W", "L", "W"] },
  { id: "s4", team: "Spurs", abbr: "TOT", played: 8, points: 14, trend: "same", form: ["L", "W", "D", "L", "D"] },
  { id: "s5", team: "Newcastle", abbr: "NEW", played: 8, points: 12, trend: "down", form: ["D", "L", "W", "L", "D"] },
  { id: "s6", team: "Aston Villa", abbr: "AVL", played: 8, points: 11, trend: "up", form: ["W", "D", "L", "W", "D"] },
  { id: "s7", team: "Brighton", abbr: "BHA", played: 8, points: 11, trend: "same", form: ["D", "D", "W", "L", "W"] },
  { id: "s8", team: "Chelsea", abbr: "CHE", played: 8, points: 10, trend: "up", form: ["L", "W", "D", "W", "L"] },
  { id: "s9", team: "Man United", abbr: "MUN", played: 8, points: 9, trend: "down", form: ["W", "L", "L", "D", "L"] },
  { id: "s10", team: "West Ham", abbr: "WHU", played: 8, points: 8, trend: "same", form: ["D", "L", "D", "L", "W"] },
  { id: "s11", team: "Fulham", abbr: "FUL", played: 8, points: 8, trend: "up" },
  { id: "s12", team: "Brentford", abbr: "BRE", played: 8, points: 7, trend: "down" },
  { id: "s13", team: "Crystal Palace", abbr: "CRY", played: 8, points: 7, trend: "same" },
  { id: "s14", team: "Wolves", abbr: "WOL", played: 8, points: 6, trend: "down" },
  { id: "s15", team: "Everton", abbr: "EVE", played: 8, points: 6, trend: "same" },
  { id: "s16", team: "Nottingham Forest", abbr: "NFO", played: 8, points: 5, trend: "up" },
  { id: "s17", team: "Bournemouth", abbr: "BOU", played: 8, points: 5, trend: "down" },
  { id: "s18", team: "Leeds", abbr: "LEE", played: 8, points: 4, trend: "same" },
  { id: "s19", team: "Burnley", abbr: "BUR", played: 8, points: 3, trend: "down" },
  { id: "s20", team: "Sheffield United", abbr: "SHU", played: 8, points: 2, trend: "down" },
];

const TREND_ICON: Record<NonNullable<Standing["trend"]>, IconName> = {
  up: "chevron-up",
  down: "chevron-down",
  same: "minus",
};
const TREND_COLOR: Record<NonNullable<Standing["trend"]>, "success" | "destructive" | "muted-foreground"> = {
  up: "success",
  down: "destructive",
  same: "muted-foreground",
};


/** Standings — league table: rank, team, played, points, trend. */
export function StandingsScreen({
  league = "Premier League",
  standings = DEFAULT_STANDINGS,
  onBack,
}: StandingsScreenProps) {
  const insets = useSafeAreaInsets();

  return (
    <World primary="#65A30D">
    <SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
      <View pointerEvents="box-none" className="absolute inset-x-4 z-10" style={{ top: insets.top + 8 }}>
        <View className="flex-row items-center justify-between">
          <Glass interactive effect="regular" className="h-11 w-11 items-center justify-center rounded-full">
            <Press
              haptic="light"
              onPress={() => onBack?.()}
              accessibilityRole="button"
              accessibilityLabel="Go back"
              className="h-9 w-9 items-center justify-center"
            >
              <Icon name="chevron-left" size="md" color="foreground" />
            </Press>
          </Glass>
          <View className="h-11 w-11" />
        </View>
        <View pointerEvents="none" className="absolute inset-0 items-center justify-center">
          <View className="h-11 flex-row items-center justify-center gap-2 rounded-full pl-3.5 pr-5">
            <Glass effect="regular" className="absolute inset-0 rounded-full" />
            <LumioMark size={18} />
            <Text accessibilityRole="header" className="text-sm font-bold tracking-tight">
              {league}
            </Text>
          </View>
        </View>
      </View>
      <Text variant="muted" className="mt-14 px-6 pb-2 text-center text-xs">
        Matchday 7 · updated after yesterday's results
      </Text>

      {/* Column key — what each number column means. */}
      <View className="mx-4 mb-1 flex-row items-center">
        <Text className="w-[72px] pl-2 text-[10px] font-medium uppercase text-muted-foreground">
          #
        </Text>
        <Text className="flex-1 text-[10px] font-medium uppercase text-muted-foreground">
          Team
        </Text>
        <Text className="w-9 text-center text-[10px] font-medium uppercase text-muted-foreground">
          P
        </Text>
        <Text className="w-11 text-center text-[10px] font-medium uppercase text-muted-foreground">
          Pts
        </Text>
        <View className="w-6" />
      </View>

      <ScrollView
        showsVerticalScrollIndicator={false}
        contentContainerStyle={{ paddingBottom: insets.bottom + 24 }}
      >
        <Mount className="mx-4 overflow-hidden rounded-3xl bg-white dark:bg-[#1A1A20]">
          {standings.map((s, i) => (
            <React.Fragment key={s.id}>
              {i > 0 && <List.Separator />}
              <View
                className={`flex-row items-center py-2.5 pl-1 pr-3 ${
                  i < 4
                    ? "border-l-2 border-success"
                    : i >= standings.length - 3
                      ? "border-l-2 border-destructive"
                      : "border-l-2 border-transparent"
                }`}
              >
                <View className="w-7 items-center">
                  <Text
                    className={`text-sm font-semibold ${
                      i < 4
                        ? "text-success"
                        : i >= standings.length - 3
                          ? "text-destructive"
                          : ""
                    }`}
                  >
                    {i + 1}
                  </Text>
                </View>
                <View className="h-7 w-7 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-[8px] font-bold tracking-tight">
                    {s.abbr}
                  </Text>
                </View>
                <View className="flex-1 pl-2.5">
                  <Text className="text-[14px] font-medium" numberOfLines={1}>
                    {s.team}
                  </Text>
                  {/* Form dots — green W / gray D / red L, the FotMob idiom
                      (more glanceable than letters). */}
                  {s.form && (
                    <View className="flex-row gap-1 pt-1">
                      {s.form.map((r, ri) => (
                        <View
                          key={ri}
                          className={`h-1.5 w-1.5 rounded-full ${
                            r === "W"
                              ? "bg-emerald-500"
                              : r === "L"
                                ? "bg-rose-500"
                                : "bg-zinc-300 dark:bg-zinc-600"
                          }`}
                        />
                      ))}
                    </View>
                  )}
                </View>
                <Text className="w-9 text-center text-xs text-muted-foreground">
                  {s.played}
                </Text>
                <Text className="w-11 text-center text-sm font-bold" style={{ fontFamily: MONO, fontVariant: ["tabular-nums"] }}>
                  {s.points}
                </Text>
                <View className="w-6 items-center">
                  {s.trend && (
                    <Icon
                      name={TREND_ICON[s.trend]}
                      size="sm"
                      color={TREND_COLOR[s.trend]}
                    />
                  )}
                </View>
              </View>
            </React.Fragment>
          ))}
        </Mount>
        {/* Zone legend — the edge colors mean something. */}
        <Mount delay={60} className="mx-4 mt-4 flex-row gap-4 px-2">
          {[
            { cls: "bg-success", label: "Champions League" },
            { cls: "bg-destructive", label: "Relegation" },
          ].map((z) => (
            <View key={z.label} className="flex-row items-center gap-1.5">
              <View className={`h-2 w-2 rounded-full ${z.cls}`} />
              <Text className="text-[11px] text-muted-foreground">{z.label}</Text>
            </View>
          ))}
        </Mount>
      </ScrollView>
    </SafeAreaView>
    </World>
  );
}
StandingsScreen.displayName = "StandingsScreen";
agent prompt — paste into Claude Code, Cursor, Devin…
Recreate the "Standings Screen" screen in React Native using LumioUI.

Goal: League table with trends 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-standings
```

Or pull just the components: `npx lumioui add button icon list text`

Native packages:
- @lumioui/ui@latest
- react-native-safe-area-context@*
- @lumioui/core@latest
- 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

### `icon` — Lucide icon set mapped to theme colors and sizes.
- `<Icon>` ×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>` ×12

## 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/standings.tsx` exporting StandingsScreen. 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 { Glass, Icon, List, Text, type IconName } from "@lumioui/ui";
import { LumioMark, MONO, Mount, Press, World } from "../shared";

export interface Standing {
  id: string;
  team: string;
  abbr: string;
  played: number;
  points: number;
  trend?: "up" | "down" | "same";
  /** Last-5 results, oldest → newest. */
  form?: ("W" | "D" | "L")[];
}

export interface StandingsScreenProps {
  league?: string;
  standings?: Standing[];
  onBack?: () => void;
}

const DEFAULT_STANDINGS: Standing[] = [
  { id: "s1", team: "Arsenal", abbr: "ARS", played: 8, points: 20, trend: "up", form: ["W", "W", "D", "W", "W"] },
  { id: "s2", team: "Man City", abbr: "MCI", played: 8, points: 19, trend: "down", form: ["W", "L", "W", "D", "W"] },
  { id: "s3", team: "Liverpool", abbr: "LIV", played: 8, points: 18, trend: "up", form: ["D", "W", "W", "L", "W"] },
  { id: "s4", team: "Spurs", abbr: "TOT", played: 8, points: 14, trend: "same", form: ["L", "W", "D", "L", "D"] },
  { id: "s5", team: "Newcastle", abbr: "NEW", played: 8, points: 12, trend: "down", form: ["D", "L", "W", "L", "D"] },
  { id: "s6", team: "Aston Villa", abbr: "AVL", played: 8, points: 11, trend: "up", form: ["W", "D", "L", "W", "D"] },
  { id: "s7", team: "Brighton", abbr: "BHA", played: 8, points: 11, trend: "same", form: ["D", "D", "W", "L", "W"] },
  { id: "s8", team: "Chelsea", abbr: "CHE", played: 8, points: 10, trend: "up", form: ["L", "W", "D", "W", "L"] },
  { id: "s9", team: "Man United", abbr: "MUN", played: 8, points: 9, trend: "down", form: ["W", "L", "L", "D", "L"] },
  { id: "s10", team: "West Ham", abbr: "WHU", played: 8, points: 8, trend: "same", form: ["D", "L", "D", "L", "W"] },
  { id: "s11", team: "Fulham", abbr: "FUL", played: 8, points: 8, trend: "up" },
  { id: "s12", team: "Brentford", abbr: "BRE", played: 8, points: 7, trend: "down" },
  { id: "s13", team: "Crystal Palace", abbr: "CRY", played: 8, points: 7, trend: "same" },
  { id: "s14", team: "Wolves", abbr: "WOL", played: 8, points: 6, trend: "down" },
  { id: "s15", team: "Everton", abbr: "EVE", played: 8, points: 6, trend: "same" },
  { id: "s16", team: "Nottingham Forest", abbr: "NFO", played: 8, points: 5, trend: "up" },
  { id: "s17", team: "Bournemouth", abbr: "BOU", played: 8, points: 5, trend: "down" },
  { id: "s18", team: "Leeds", abbr: "LEE", played: 8, points: 4, trend: "same" },
  { id: "s19", team: "Burnley", abbr: "BUR", played: 8, points: 3, trend: "down" },
  { id: "s20", team: "Sheffield United", abbr: "SHU", played: 8, points: 2, trend: "down" },
];

const TREND_ICON: Record<NonNullable<Standing["trend"]>, IconName> = {
  up: "chevron-up",
  down: "chevron-down",
  same: "minus",
};
const TREND_COLOR: Record<NonNullable<Standing["trend"]>, "success" | "destructive" | "muted-foreground"> = {
  up: "success",
  down: "destructive",
  same: "muted-foreground",
};

/** Standings — league table: rank, team, played, points, trend. */
export function StandingsScreen({
  league = "Premier League",
  standings = DEFAULT_STANDINGS,
  onBack,
}: StandingsScreenProps) {
  const insets = useSafeAreaInsets();

  return (
    <World primary="#65A30D">
    <SafeAreaView className="flex-1 bg-[#F4F5F9] dark:bg-[#111114]" edges={["top"]}>
      <View pointerEvents="box-none" className="absolute inset-x-4 z-10" style={{ top: insets.top + 8 }}>
        <View className="flex-row items-center justify-between">
          <Glass interactive effect="regular" className="h-11 w-11 items-center justify-center rounded-full">
            <Press
              haptic="light"
              onPress={() => onBack?.()}
              accessibilityRole="button"
              accessibilityLabel="Go back"
              className="h-9 w-9 items-center justify-center"
            >
              <Icon name="chevron-left" size="md" color="foreground" />
            </Press>
          </Glass>
          <View className="h-11 w-11" />
        </View>
        <View pointerEvents="none" className="absolute inset-0 items-center justify-center">
          <View className="h-11 flex-row items-center justify-center gap-2 rounded-full pl-3.5 pr-5">
            <Glass effect="regular" className="absolute inset-0 rounded-full" />
            <LumioMark size={18} />
            <Text accessibilityRole="header" className="text-sm font-bold tracking-tight">
              {league}
            </Text>
          </View>
        </View>
      </View>
      <Text variant="muted" className="mt-14 px-6 pb-2 text-center text-xs">
        Matchday 7 · updated after yesterday's results
      </Text>

      {/* Column key — what each number column means. */}
      <View className="mx-4 mb-1 flex-row items-center">
        <Text className="w-[72px] pl-2 text-[10px] font-medium uppercase text-muted-foreground">
          #
        </Text>
        <Text className="flex-1 text-[10px] font-medium uppercase text-muted-foreground">
          Team
        </Text>
        <Text className="w-9 text-center text-[10px] font-medium uppercase text-muted-foreground">
          P
        </Text>
        <Text className="w-11 text-center text-[10px] font-medium uppercase text-muted-foreground">
          Pts
        </Text>
        <View className="w-6" />
      </View>

      <ScrollView
        showsVerticalScrollIndicator={false}
        contentContainerStyle={{ paddingBottom: insets.bottom + 24 }}
      >
        <Mount className="mx-4 overflow-hidden rounded-3xl bg-white dark:bg-[#1A1A20]">
          {standings.map((s, i) => (
            <React.Fragment key={s.id}>
              {i > 0 && <List.Separator />}
              <View
                className={`flex-row items-center py-2.5 pl-1 pr-3 ${
                  i < 4
                    ? "border-l-2 border-success"
                    : i >= standings.length - 3
                      ? "border-l-2 border-destructive"
                      : "border-l-2 border-transparent"
                }`}
              >
                <View className="w-7 items-center">
                  <Text
                    className={`text-sm font-semibold ${
                      i < 4
                        ? "text-success"
                        : i >= standings.length - 3
                          ? "text-destructive"
                          : ""
                    }`}
                  >
                    {i + 1}
                  </Text>
                </View>
                <View className="h-7 w-7 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-[8px] font-bold tracking-tight">
                    {s.abbr}
                  </Text>
                </View>
                <View className="flex-1 pl-2.5">
                  <Text className="text-[14px] font-medium" numberOfLines={1}>
                    {s.team}
                  </Text>
                  {/* Form dots — green W / gray D / red L, the FotMob idiom
                      (more glanceable than letters). */}
                  {s.form && (
                    <View className="flex-row gap-1 pt-1">
                      {s.form.map((r, ri) => (
                        <View
                          key={ri}
                          className={`h-1.5 w-1.5 rounded-full ${
                            r === "W"
                              ? "bg-emerald-500"
                              : r === "L"
                                ? "bg-rose-500"
                                : "bg-zinc-300 dark:bg-zinc-600"
                          }`}
                        />
                      ))}
                    </View>
                  )}
                </View>
                <Text className="w-9 text-center text-xs text-muted-foreground">
                  {s.played}
                </Text>
                <Text className="w-11 text-center text-sm font-bold" style={{ fontFamily: MONO, fontVariant: ["tabular-nums"] }}>
                  {s.points}
                </Text>
                <View className="w-6 items-center">
                  {s.trend && (
                    <Icon
                      name={TREND_ICON[s.trend]}
                      size="sm"
                      color={TREND_COLOR[s.trend]}
                    />
                  )}
                </View>
              </View>
            </React.Fragment>
          ))}
        </Mount>
        {/* Zone legend — the edge colors mean something. */}
        <Mount delay={60} className="mx-4 mt-4 flex-row gap-4 px-2">
          {[
            { cls: "bg-success", label: "Champions League" },
            { cls: "bg-destructive", label: "Relegation" },
          ].map((z) => (
            <View key={z.label} className="flex-row items-center gap-1.5">
              <View className={`h-2 w-2 rounded-full ${z.cls}`} />
              <Text className="text-[11px] text-muted-foreground">{z.label}</Text>
            </View>
          ))}
        </Mount>
      </ScrollView>
    </SafeAreaView>
    </World>
  );
}
StandingsScreen.displayName = "StandingsScreen";
```

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