Onboarding pick-list over nebula world: emoji rows fill accent when selected, Continue/Skip
import * as React from "react";
import { useState } from "react";
import { View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { Button, Icon, Text, type IconName } from "@lumioui/ui";
import { cn, useHaptic } from "@lumioui/core";
import { Mount, Press, StickyBottomBar } from "../shared";
interface Preference {
id: string;
icon: IconName;
label: string;
on?: boolean;
}
const PREFS: Preference[] = [
{ id: "delays", icon: "bell", label: "Live delay updates", on: true },
{ id: "gates", icon: "pin", label: "Gate changes" },
{ id: "ai", icon: "sparkles", label: "AI flight assistant", on: true },
{ id: "stats", icon: "grid", label: "Flight stats" },
{ id: "widgets", icon: "lock", label: "Lock screen widgets" },
{ id: "lounge", icon: "coffee", label: "Lounge info" },
];
/** Flight preferences — onboarding pick-list over the nebula world: glowing
* emoji rows that fill accent when selected, up to N, then Continue/Skip. */
export function FlightPreferencesScreen({
preferences = PREFS,
max = 3,
onContinue,
onSkip,
onBack,
}: {
preferences?: Preference[];
max?: number;
onContinue?: (selected: string[]) => void;
onSkip?: () => void;
onBack?: () => void;
}) {
const haptics = useHaptic();
const [selected, setSelected] = useState<Set<string>>(
() => new Set(preferences.filter((p) => p.on).map((p) => p.id))
);
const toggle = (id: string) => {
haptics.selection();
setSelected((s) => {
const next = new Set(s);
if (next.has(id)) next.delete(id);
else if (next.size < max) next.add(id);
return next;
});
};
return (
<View className="flex-1 bg-[#111114]">
<SafeAreaView className="flex-1" edges={["top"]}>
<View className="flex-row items-center gap-4 px-4 pt-1">
<Press
onPress={() => {
haptics.light();
onBack?.();
}}
accessibilityRole="button"
accessibilityLabel="Go back"
hitSlop={12}
className="h-9 w-9 items-center justify-center rounded-full bg-white/10"
>
<Icon name="chevron-left" size="sm" color="primaryForeground" />
</Press>
<View className="flex-1 flex-row gap-1.5">
{[0, 1, 2, 3].map((i) => (
<View key={i} className={cn("h-1 flex-1 rounded-full", i < 1 ? "bg-[#BEF04C]" : "bg-white/15")} />
))}
</View>
</View>
<Mount className="mt-8 px-6">
<Text className="text-[32px] font-bold leading-tight tracking-tight text-white">
What matters{"\n"}most to you?
</Text>
<Text className="mt-2 text-[14px] text-white/55">Pick up to {max}</Text>
</Mount>
<Mount delay={80} className="mt-7 gap-2.5 px-6">
{preferences.map((p) => {
const on = selected.has(p.id);
return (
<Press
key={p.id}
onPress={() => toggle(p.id)}
accessibilityRole="button"
accessibilityLabel={p.label}
accessibilityState={{ selected: on }}
className={cn(
"h-14 flex-row items-center gap-3.5 rounded-2xl px-4",
on ? "bg-[#BEF04C]" : "bg-white/[0.07]"
)}
>
<Icon name={p.icon} size="md" color={on ? "#1B1B26" : "#FFFFFF"} />
<Text className={cn("flex-1 text-[15px] font-semibold", on ? "text-[#1B1B26]" : "text-white/85")}>
{p.label}
</Text>
<View
className={cn(
"h-6 w-6 items-center justify-center rounded-full",
on ? "bg-[#1B1B26]" : "border border-white/20 bg-white/10"
)}
>
{on ? <Icon name="check" size="sm" color="#BEF04C" /> : null}
</View>
</Press>
);
})}
</Mount>
<StickyBottomBar className="gap-2.5 px-6">
<Button
size="lg"
className="w-full bg-white"
textClassName="text-[#0B0912]"
onPress={() => {
haptics.light();
onContinue?.([...selected]);
}}
accessibilityLabel="Continue"
>
Continue
</Button>
<Button
variant="ghost"
size="lg"
className="w-full bg-white/[0.07]"
onPress={() => {
haptics.selection();
onSkip?.();
}}
accessibilityLabel="Skip"
>
<Text className="text-white/85">Skip</Text>
</Button>
</StickyBottomBar>
</SafeAreaView>
</View>
);
}
FlightPreferencesScreen.displayName = "FlightPreferencesScreen";
Recreate the "Flight Preferences Screen" screen in React Native using LumioUI.
Goal: Onboarding pick-list over nebula world: emoji rows fill accent when selected, Continue/Skip 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 travel-flight-preferences
```
Or pull just the components: `npx lumioui add button icon 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>` ×3
### `text` — Themed type scale from caption to display.
- `<Text>` ×4
## 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/travel/flight-preferences.tsx` exporting FlightPreferencesScreen. 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 { Button, Icon, Text, type IconName } from "@lumioui/ui";
import { cn, useHaptic } from "@lumioui/core";
import { Mount, Press, StickyBottomBar } from "../shared";
interface Preference {
id: string;
icon: IconName;
label: string;
on?: boolean;
}
const PREFS: Preference[] = [
{ id: "delays", icon: "bell", label: "Live delay updates", on: true },
{ id: "gates", icon: "pin", label: "Gate changes" },
{ id: "ai", icon: "sparkles", label: "AI flight assistant", on: true },
{ id: "stats", icon: "grid", label: "Flight stats" },
{ id: "widgets", icon: "lock", label: "Lock screen widgets" },
{ id: "lounge", icon: "coffee", label: "Lounge info" },
];
/** Flight preferences — onboarding pick-list over the nebula world: glowing
* emoji rows that fill accent when selected, up to N, then Continue/Skip. */
export function FlightPreferencesScreen({
preferences = PREFS,
max = 3,
onContinue,
onSkip,
onBack,
}: {
preferences?: Preference[];
max?: number;
onContinue?: (selected: string[]) => void;
onSkip?: () => void;
onBack?: () => void;
}) {
const haptics = useHaptic();
const [selected, setSelected] = useState<Set<string>>(
() => new Set(preferences.filter((p) => p.on).map((p) => p.id))
);
const toggle = (id: string) => {
haptics.selection();
setSelected((s) => {
const next = new Set(s);
if (next.has(id)) next.delete(id);
else if (next.size < max) next.add(id);
return next;
});
};
return (
<View className="flex-1 bg-[#111114]">
<SafeAreaView className="flex-1" edges={["top"]}>
<View className="flex-row items-center gap-4 px-4 pt-1">
<Press
onPress={() => {
haptics.light();
onBack?.();
}}
accessibilityRole="button"
accessibilityLabel="Go back"
hitSlop={12}
className="h-9 w-9 items-center justify-center rounded-full bg-white/10"
>
<Icon name="chevron-left" size="sm" color="primaryForeground" />
</Press>
<View className="flex-1 flex-row gap-1.5">
{[0, 1, 2, 3].map((i) => (
<View key={i} className={cn("h-1 flex-1 rounded-full", i < 1 ? "bg-[#BEF04C]" : "bg-white/15")} />
))}
</View>
</View>
<Mount className="mt-8 px-6">
<Text className="text-[32px] font-bold leading-tight tracking-tight text-white">
What matters{"\n"}most to you?
</Text>
<Text className="mt-2 text-[14px] text-white/55">Pick up to {max}</Text>
</Mount>
<Mount delay={80} className="mt-7 gap-2.5 px-6">
{preferences.map((p) => {
const on = selected.has(p.id);
return (
<Press
key={p.id}
onPress={() => toggle(p.id)}
accessibilityRole="button"
accessibilityLabel={p.label}
accessibilityState={{ selected: on }}
className={cn(
"h-14 flex-row items-center gap-3.5 rounded-2xl px-4",
on ? "bg-[#BEF04C]" : "bg-white/[0.07]"
)}
>
<Icon name={p.icon} size="md" color={on ? "#1B1B26" : "#FFFFFF"} />
<Text className={cn("flex-1 text-[15px] font-semibold", on ? "text-[#1B1B26]" : "text-white/85")}>
{p.label}
</Text>
<View
className={cn(
"h-6 w-6 items-center justify-center rounded-full",
on ? "bg-[#1B1B26]" : "border border-white/20 bg-white/10"
)}
>
{on ? <Icon name="check" size="sm" color="#BEF04C" /> : null}
</View>
</Press>
);
})}
</Mount>
<StickyBottomBar className="gap-2.5 px-6">
<Button
size="lg"
className="w-full bg-white"
textClassName="text-[#0B0912]"
onPress={() => {
haptics.light();
onContinue?.([...selected]);
}}
accessibilityLabel="Continue"
>
Continue
</Button>
<Button
variant="ghost"
size="lg"
className="w-full bg-white/[0.07]"
onPress={() => {
haptics.selection();
onSkip?.();
}}
accessibilityLabel="Skip"
>
<Text className="text-white/85">Skip</Text>
</Button>
</StickyBottomBar>
</SafeAreaView>
</View>
);
}
FlightPreferencesScreen.displayName = "FlightPreferencesScreen";
```
Screen: https://lumioui.dev/screens/travel-flight-preferences