Settings

iOS-style settings with a large title that collapses into the header bar as you scroll, a profile card, a storage bar that fills on mount and grouped rows that stagger in. Custom spring switches with an interpolated track colour, plus a sliding three-way appearance control.

settingslistprofilepreferencesswitchsegmented-controlcollapsing-headeranimationreanimated
Paste into Claude Code Cursor Codex Lovable RapidNative
Live preview · follows the site themeOpen full screen

Details

File
components/patterns/settings.tsx
Lines
587
Stack
React Native, StyleSheet
Packages
expo-linear-gradient, lucide-react-native, react-native-reanimated, react-native-safe-area-context, react-native-svg, react-native-worklets
Platforms
iOS, Android, Web

Using gluestack-ui?

Optional. The screen is plain React Native; these components can stand in for its primitives.

components/patterns/settings.tsx
1import { useEffect, useState, type ReactNode } from 'react';
2import { Image, Pressable, StyleSheet, Text, View, useColorScheme } from 'react-native';
3import Animated, {
4 Easing,
5 FadeIn,
6 FadeInDown,
7 interpolate,
8 interpolateColor,
9 useAnimatedScrollHandler,
10 useAnimatedStyle,
11 useSharedValue,
12 withDelay,
13 withSpring,
14 withTiming,
15 ZoomIn,
16 type SharedValue,
17} from 'react-native-reanimated';
18import { LinearGradient } from 'expo-linear-gradient';
19import { useSafeAreaInsets } from 'react-native-safe-area-context';
20import {
21 Bell,
22 ChevronRight,
23 Cloud,
24 CreditCard,
25 Globe,
26 LifeBuoy,
27 LogOut,
28 MessageCircle,
29 Moon,
30 ScanFace,
31 ShieldCheck,
32 Smartphone,
33 Sparkles,
34 Star,
35 Sun,
36 UserRound,
37 Vibrate,
38 type LucideIcon,
39} from 'lucide-react-native';
40
41// ─── Brand ──────────────────────────────────────────────────────────────────
42// The screen's accent. Every accent colour below derives from these, so changing them rebrands the screen.
43
44const ACCENT = '#1064FF';
45const ACCENT_DARK = '#5B97FF'; // the accent on dark backgrounds
46const ON_ACCENT = '#FFFFFF'; // text and icons on an accent fill
47
48/** `hex` at `alpha` opacity, as rgba(). */
49function tint(hex: string, alpha: number) {
50 const n = parseInt(hex.slice(1), 16);
51 return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${alpha})`;
52}
53
54/** `hex` with its hue turned by `deg` and its lightness and saturation moved by `light` and `sat` (HSL, -1 to 1), for colours that run warmer, cooler or brighter than the accent. */
55function spin(hex: string, deg: number, light = 0, sat = 0) {
56 const n = parseInt(hex.slice(1), 16);
57 const r = ((n >> 16) & 255) / 255;
58 const g = ((n >> 8) & 255) / 255;
59 const b = (n & 255) / 255;
60 const max = Math.max(r, g, b);
61 const min = Math.min(r, g, b);
62 const d = max - min;
63 const s = Math.min(1, Math.max(0, (d === 0 ? 0 : d / (1 - Math.abs(max + min - 1))) + sat));
64 const l = Math.min(1, Math.max(0, (max + min) / 2 + light));
65 const h0 = d === 0 ? 0 : max === r ? ((g - b) / d + 6) % 6 : max === g ? (b - r) / d + 2 : (r - g) / d + 4;
66 const h = (((h0 * 60 + deg) % 360) + 360) % 360;
67 const a = s * Math.min(l, 1 - l);
68 const f = (m: number) => {
69 const k = (m + h / 30) % 12;
70 return Math.round(255 * (l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1)))).toString(16).padStart(2, '0');
71 };
72 return `#${f(0)}${f(8)}${f(4)}`.toUpperCase();
73}
74
75// ─── Sample data ────────────────────────────────────────────────────────────
76
77const USER = {
78 name: 'Ada Lovelace',
79 email: 'ada@example.com',
80 avatar: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=200&q=80',
81 plan: 'Pro',
82};
83
84const STORAGE = {
85 total: 50,
86 parts: [
87 { label: 'Photos', gb: 21.4, color: '#1064FF' },
88 { label: 'Documents', gb: 11.6, color: '#8B5CF6' },
89 { label: 'Backups', gb: 5.2, color: '#14B8A6' },
90 ],
91};
92
93type Link = { id: string; label: string; icon: LucideIcon; tint: string; value?: string };
94type Toggle = { id: string; label: string; icon: LucideIcon; tint: string; on: boolean };
95
96const ACCOUNT: Link[] = [
97 { id: 'details', label: 'Personal details', icon: UserRound, tint: '#1064FF' },
98 { id: 'privacy', label: 'Privacy and security', icon: ShieldCheck, tint: '#16A34A' },
99 { id: 'subscription', label: 'Subscription', icon: CreditCard, tint: '#F59E0B', value: 'Pro' },
100];
101
102const TOGGLES: Toggle[] = [
103 { id: 'notifications', label: 'Notifications', icon: Bell, tint: '#F43F5E', on: true },
104 { id: 'faceId', label: 'Face ID', icon: ScanFace, tint: '#10B981', on: true },
105 { id: 'haptics', label: 'Haptic feedback', icon: Vibrate, tint: '#F59E0B', on: false },
106];
107
108const LANGUAGE: Link = { id: 'language', label: 'Language', icon: Globe, tint: '#0EA5E9', value: 'English' };
109
110const MODES = [
111 { id: 'system', label: 'System', icon: Smartphone },
112 { id: 'light', label: 'Light', icon: Sun },
113 { id: 'dark', label: 'Dark', icon: Moon },
114] as const;
115type Mode = (typeof MODES)[number]['id'];
116
117const SUPPORT: Link[] = [
118 { id: 'help', label: 'Help center', icon: LifeBuoy, tint: '#14B8A6' },
119 { id: 'feedback', label: 'Send feedback', icon: MessageCircle, tint: '#EC4899' },
120 { id: 'rate', label: 'Rate the app', icon: Star, tint: '#EAB308' },
121];
122
123const VERSION = 'Version 2.4.0 (318)';
124
125// ─── Palette ────────────────────────────────────────────────────────────────
126
127const SPRING = { damping: 18, stiffness: 260, mass: 0.7 };
128const BAR = 44;
129const GUTTER = 16;
130
131function usePalette() {
132 const dark = useColorScheme() === 'dark';
133 return {
134 dark,
135 bg: dark ? '#000000' : '#F3F3F6',
136 fg: dark ? '#FAFAFA' : '#0A0A0A',
137 muted: dark ? '#8E8E93' : '#6E6E76',
138 faint: dark ? '#55555B' : '#B4B4BC',
139 card: dark ? '#141416' : '#FFFFFF',
140 edge: dark ? '#202024' : '#EAEAEE',
141 line: dark ? '#26262A' : '#ECECEF',
142 press: dark ? '#1E1E22' : '#F4F4F6',
143 track: dark ? '#39393E' : '#E3E3E8',
144 seg: dark ? '#0A0A0B' : '#F0F0F3',
145 segThumb: dark ? '#2C2C31' : '#FFFFFF',
146 danger: dark ? '#FF6B6B' : '#E5484D',
147 // Accent as text on its own wash.
148 accent: dark ? ACCENT_DARK : ACCENT,
149 // Icon squares: the row's tint at low strength behind the full-strength glyph.
150 wash: (hex: string) => tint(hex, dark ? 0.17 : 0.12),
151 };
152}
153
154const enter = (delay: number) => FadeInDown.delay(delay).duration(440);
155
156// ─── Small pieces ───────────────────────────────────────────────────────────
157
158function IconTile({ icon: Icon, tint, children }: { icon?: LucideIcon; tint: string; children?: ReactNode }) {
159 const c = usePalette();
160 return (
161 <View style={[styles.iconTile, { backgroundColor: c.wash(tint) }]}>
162 {Icon ? <Icon size={17} color={tint} strokeWidth={2.2} /> : children}
163 </View>
164 );
165}
166
167function Card({ children, delay }: { children: ReactNode; delay: number }) {
168 const c = usePalette();
169 return (
170 <Animated.View entering={enter(delay)} style={[styles.card, { backgroundColor: c.card, borderColor: c.edge }]}>
171 {children}
172 </Animated.View>
173 );
174}
175
176function Section({ title, footer, delay, children }: { title: string; footer?: string; delay: number; children: ReactNode }) {
177 const c = usePalette();
178 return (
179 <View style={styles.section}>
180 <Animated.Text entering={FadeIn.delay(delay).duration(400)} style={[styles.sectionTitle, { color: c.muted }]}>
181 {title.toUpperCase()}
182 </Animated.Text>
183 <Card delay={delay}>{children}</Card>
184 {footer ? (
185 <Animated.Text entering={FadeIn.delay(delay + 200).duration(400)} style={[styles.sectionFooter, { color: c.muted }]}>
186 {footer}
187 </Animated.Text>
188 ) : null}
189 </View>
190 );
191}
192
193/** One line of a group: staggers in, with a hairline inset to the label above it. */
194function RowShell({ delay, first, children }: { delay: number; first?: boolean; children: ReactNode }) {
195 const c = usePalette();
196 return (
197 <Animated.View entering={FadeInDown.delay(delay).duration(380)}>
198 {!first && <View style={[styles.rowRule, { backgroundColor: c.line }]} />}
199 {children}
200 </Animated.View>
201 );
202}
203
204function LinkRow({ item, delay, first }: { item: Link; delay: number; first?: boolean }) {
205 const c = usePalette();
206 return (
207 <RowShell delay={delay} first={first}>
208 {/* Push the row's screen from onPress. */}
209 <Pressable
210 role="button"
211 aria-label={item.value ? `${item.label}, ${item.value}` : item.label}
212 style={({ pressed }) => [styles.row, { backgroundColor: pressed ? c.press : 'transparent' }]}
213 >
214 <IconTile icon={item.icon} tint={item.tint} />
215 <Text numberOfLines={1} style={[styles.rowLabel, { color: c.fg }]}>
216 {item.label}
217 </Text>
218 {item.value ? <Text style={[styles.rowValue, { color: c.muted }]}>{item.value}</Text> : null}
219 <ChevronRight size={18} color={c.faint} strokeWidth={2.4} />
220 </Pressable>
221 </RowShell>
222 );
223}
224
225// ─── Switch: the thumb springs across and the track colour follows it ───────
226
227function Switch({ on, pressed }: { on: boolean; pressed: SharedValue<number> }) {
228 const c = usePalette();
229 const p = useSharedValue(on ? 1 : 0);
230 useEffect(() => {
231 p.value = withSpring(on ? 1 : 0, SPRING);
232 }, [on, p]);
233 const track = useAnimatedStyle(() => ({ backgroundColor: interpolateColor(p.value, [0, 1], [c.track, ACCENT]) }));
234 // While held, the thumb stretches toward the side it is about to travel to.
235 const thumb = useAnimatedStyle(() => {
236 const stretch = pressed.value * 5;
237 return { width: 27 + stretch, transform: [{ translateX: p.value * (20 - stretch) }] };
238 });
239 return (
240 <Animated.View style={[styles.switch, track]}>
241 <Animated.View style={[styles.switchThumb, thumb]} />
242 </Animated.View>
243 );
244}
245
246function SwitchRow({ item, on, onToggle, delay, first }: { item: Toggle; on: boolean; onToggle: () => void; delay: number; first?: boolean }) {
247 const c = usePalette();
248 const pressed = useSharedValue(0);
249 return (
250 <RowShell delay={delay} first={first}>
251 {/* The whole row is the switch, so the target is as wide as the card. */}
252 <Pressable
253 role="switch"
254 aria-checked={on}
255 aria-label={item.label}
256 onPress={onToggle}
257 onPressIn={() => (pressed.value = withTiming(1, { duration: 120 }))}
258 onPressOut={() => (pressed.value = withTiming(0, { duration: 180 }))}
259 style={styles.row}
260 >
261 <IconTile icon={item.icon} tint={item.tint} />
262 <Text numberOfLines={1} style={[styles.rowLabel, { color: c.fg }]}>
263 {item.label}
264 </Text>
265 <Switch on={on} pressed={pressed} />
266 </Pressable>
267 </RowShell>
268 );
269}
270
271// ─── Appearance: a three-way control with a sliding thumb ───────────────────
272
273function AppearanceRow({ delay }: { delay: number }) {
274 const c = usePalette();
275 // Local only. In your app, call Appearance.setColorScheme and persist the choice.
276 const [mode, setMode] = useState<Mode>('system');
277 const index = MODES.findIndex((m) => m.id === mode);
278 const active = MODES[index];
279 const x = useSharedValue(index);
280 useEffect(() => {
281 x.value = withSpring(index, { damping: 20, stiffness: 240, mass: 0.7 });
282 }, [index, x]);
283 const thumb = useAnimatedStyle(() => ({ left: `${(x.value * 100) / MODES.length}%` }));
284 const ActiveIcon = active.icon;
285
286 return (
287 <RowShell delay={delay}>
288 <View style={styles.appearance}>
289 <View style={styles.appearanceHead}>
290 <IconTile tint="#6366F1">
291 <Animated.View key={mode} entering={ZoomIn.duration(200)}>
292 <ActiveIcon size={17} color="#6366F1" strokeWidth={2.2} />
293 </Animated.View>
294 </IconTile>
295 <Text style={[styles.rowLabel, { color: c.fg }]}>Appearance</Text>
296 <Animated.Text key={mode} entering={FadeIn.duration(200)} style={[styles.rowValue, { color: c.muted }]}>
297 {active.label}
298 </Animated.Text>
299 </View>
300
301 <View role="tablist" aria-label="Appearance" style={[styles.segmented, { backgroundColor: c.seg }]}>
302 <View style={styles.segments}>
303 <Animated.View style={[styles.segThumb, c.dark ? styles.segThumbShadowDark : styles.segThumbShadowLight, { backgroundColor: c.segThumb }, thumb]} />
304 {MODES.map((m) => {
305 const selected = m.id === mode;
306 const Icon = m.icon;
307 return (
308 <Pressable
309 key={m.id}
310 role="tab"
311 aria-label={m.label}
312 aria-selected={selected}
313 onPress={() => setMode(m.id)}
314 style={styles.segment}
315 >
316 <Icon size={15} color={selected ? c.fg : c.muted} strokeWidth={2.2} />
317 <Text style={[styles.segmentLabel, { color: selected ? c.fg : c.muted, fontWeight: selected ? '600' : '500' }]}>{m.label}</Text>
318 </Pressable>
319 );
320 })}
321 </View>
322 </View>
323 </View>
324 </RowShell>
325 );
326}
327
328// ─── Profile and storage cards ──────────────────────────────────────────────
329
330function ProfileCard() {
331 const c = usePalette();
332 const scale = useSharedValue(1);
333 const style = useAnimatedStyle(() => ({ transform: [{ scale: scale.value }] }));
334 return (
335 <Animated.View entering={enter(60)}>
336 <Pressable
337 role="button"
338 aria-label={`${USER.name}, ${USER.plan} plan. Edit profile`}
339 onPressIn={() => (scale.value = withSpring(0.97, SPRING))}
340 onPressOut={() => (scale.value = withSpring(1, SPRING))}
341 >
342 <Animated.View
343 style={[styles.profile, { backgroundColor: c.card, borderColor: c.edge }, style]}
344 >
345 <Image source={{ uri: USER.avatar }} alt={USER.name} style={[styles.avatar, { backgroundColor: c.line }]} />
346 <View style={styles.profileText}>
347 <View style={styles.profileNameRow}>
348 <Text numberOfLines={1} style={[styles.profileName, { color: c.fg }]}>
349 {USER.name}
350 </Text>
351 <LinearGradient
352 colors={[ACCENT, spin(ACCENT, -31, -0.12)]}
353 start={{ x: 0, y: 0 }}
354 end={{ x: 1, y: 1 }}
355 style={styles.plan}
356 >
357 <Sparkles size={10} color={ON_ACCENT} fill={ON_ACCENT} />
358 <Text style={styles.planLabel}>{USER.plan.toUpperCase()}</Text>
359 </LinearGradient>
360 </View>
361 <Text numberOfLines={1} style={[styles.email, { color: c.muted }]}>
362 {USER.email}
363 </Text>
364 </View>
365 <ChevronRight size={20} color={c.faint} strokeWidth={2.4} />
366 </Animated.View>
367 </Pressable>
368 </Animated.View>
369 );
370}
371
372function StorageCard() {
373 const c = usePalette();
374 const used = STORAGE.parts.reduce((s, p) => s + p.gb, 0);
375 const fill = useSharedValue(0);
376 useEffect(() => {
377 fill.value = withDelay(420, withTiming(used / STORAGE.total, { duration: 1000, easing: Easing.out(Easing.cubic) }));
378 }, [fill, used]);
379 const bar = useAnimatedStyle(() => ({ width: `${fill.value * 100}%` }));
380 return (
381 <View style={styles.storageSlot}>
382 <Card delay={120}>
383 <View style={styles.storage}>
384 <View style={styles.storageHead}>
385 <IconTile icon={Cloud} tint={ACCENT} />
386 <View style={styles.flex}>
387 <Text style={[styles.storageTitle, { color: c.fg }]}>Storage</Text>
388 <Text style={[styles.storageUsed, { color: c.muted }]}>
389 {used.toFixed(1)} GB of {STORAGE.total} GB used
390 </Text>
391 </View>
392 <Pressable role="button" aria-label="Manage storage" hitSlop={8} style={({ pressed }) => [styles.manage, { backgroundColor: c.wash(ACCENT), opacity: pressed ? 0.6 : 1 }]}>
393 <Text style={[styles.manageLabel, { color: c.accent }]}>Manage</Text>
394 </Pressable>
395 </View>
396
397 {/* The filled part grows as one piece; its slices keep their share of it. */}
398 <View style={[styles.meter, { backgroundColor: c.track }]}>
399 <Animated.View style={[styles.meterFill, bar]}>
400 {STORAGE.parts.map((p) => (
401 <View key={p.label} style={{ flex: p.gb, backgroundColor: p.color }} />
402 ))}
403 </Animated.View>
404 </View>
405
406 <View style={styles.legend}>
407 {STORAGE.parts.map((p) => (
408 <View key={p.label} style={styles.legendItem}>
409 <View style={styles.legendKey}>
410 <View style={[styles.legendDot, { backgroundColor: p.color }]} />
411 <Text numberOfLines={1} style={[styles.legendLabel, { color: c.muted }]}>
412 {p.label}
413 </Text>
414 </View>
415 <Text style={[styles.legendValue, { color: c.fg }]}>{p.gb} GB</Text>
416 </View>
417 ))}
418 </View>
419 </View>
420 </Card>
421 </View>
422 );
423}
424
425// ─── Screen ─────────────────────────────────────────────────────────────────
426
427export default function SettingsScreen() {
428 const c = usePalette();
429 const insets = useSafeAreaInsets();
430 // Replace with your settings store, and persist each change.
431 const [toggles, setToggles] = useState<Record<string, boolean>>(() => Object.fromEntries(TOGGLES.map((t) => [t.id, t.on])));
432
433 const scrollY = useSharedValue(0);
434 const onScroll = useAnimatedScrollHandler((e) => {
435 scrollY.value = e.contentOffset.y;
436 });
437 // The large title leaves as the bar's own title, fill and hairline arrive.
438 const largeTitle = useAnimatedStyle(() => ({
439 opacity: interpolate(scrollY.value, [0, 34], [1, 0], 'clamp'),
440 transform: [{ scale: interpolate(scrollY.value, [-120, 0], [1.12, 1], 'clamp') }],
441 }));
442 const barFill = useAnimatedStyle(() => ({ opacity: interpolate(scrollY.value, [6, 34], [0, 1], 'clamp') }));
443 const barTitle = useAnimatedStyle(() => ({
444 opacity: interpolate(scrollY.value, [26, 50], [0, 1], 'clamp'),
445 transform: [{ translateY: interpolate(scrollY.value, [26, 50], [6, 0], 'clamp') }],
446 }));
447
448 return (
449 <View style={[styles.flex, { backgroundColor: c.bg }]}>
450 <Animated.ScrollView
451 onScroll={onScroll}
452 scrollEventThrottle={16}
453 showsVerticalScrollIndicator={false}
454 contentContainerStyle={[styles.content, { paddingTop: insets.top + 10, paddingBottom: insets.bottom + 28 }]}
455 >
456 <Animated.Text
457 role="heading"
458 entering={FadeIn.duration(400)}
459 style={[styles.largeTitle, { color: c.fg }, largeTitle]}
460 >
461 Settings
462 </Animated.Text>
463
464 <ProfileCard />
465 <StorageCard />
466
467 <Section title="Account" delay={180}>
468 {ACCOUNT.map((item, i) => (
469 <LinkRow key={item.id} item={item} first={i === 0} delay={220 + i * 45} />
470 ))}
471 </Section>
472
473 <Section title="Preferences" delay={260} footer="Face ID unlocks the app and confirms purchases.">
474 {TOGGLES.map((item, i) => (
475 <SwitchRow
476 key={item.id}
477 item={item}
478 first={i === 0}
479 delay={300 + i * 45}
480 on={toggles[item.id]}
481 onToggle={() => setToggles((t) => ({ ...t, [item.id]: !t[item.id] }))}
482 />
483 ))}
484 <LinkRow item={LANGUAGE} delay={300 + TOGGLES.length * 45} />
485 <AppearanceRow delay={300 + (TOGGLES.length + 1) * 45} />
486 </Section>
487
488 <Section title="Support" delay={340}>
489 {SUPPORT.map((item, i) => (
490 <LinkRow key={item.id} item={item} first={i === 0} delay={380 + i * 45} />
491 ))}
492 </Section>
493
494 <View style={styles.section}>
495 <Card delay={420}>
496 {/* Replace with your sign-out call. */}
497 <Pressable role="button" aria-label="Sign out" style={({ pressed }) => [styles.row, { backgroundColor: pressed ? c.press : 'transparent' }]}>
498 <IconTile icon={LogOut} tint={c.danger} />
499 <Text style={[styles.signOut, { color: c.danger }]}>Sign out</Text>
500 </Pressable>
501 </Card>
502 </View>
503
504 <Animated.Text entering={FadeIn.delay(520).duration(400)} style={[styles.version, { color: c.faint }]}>
505 {VERSION}
506 </Animated.Text>
507 </Animated.ScrollView>
508
509 {/* Header bar, over the list and under the status bar */}
510 <View pointerEvents="none" style={[styles.header, { paddingTop: insets.top }]}>
511 <Animated.View style={[styles.headerFill, { backgroundColor: c.bg, borderBottomColor: c.line }, barFill]} />
512 <View style={styles.bar}>
513 <Animated.Text style={[styles.barTitle, { color: c.fg }, barTitle]}>Settings</Animated.Text>
514 </View>
515 </View>
516 </View>
517 );
518}
519
520// ─── Styles ─────────────────────────────────────────────────────────────────
521
522const styles = StyleSheet.create({
523 flex: { flex: 1 },
524 content: { paddingHorizontal: GUTTER },
525 largeTitle: { fontSize: 34, lineHeight: 41, fontWeight: '800', letterSpacing: -1, marginLeft: 4, marginBottom: 16, transformOrigin: 'left center' },
526 header: { position: 'absolute', top: 0, left: 0, right: 0 },
527 headerFill: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, borderBottomWidth: 1 },
528 bar: { height: BAR, alignItems: 'center', justifyContent: 'center' },
529 barTitle: { fontSize: 17, fontWeight: '600', letterSpacing: -0.2 },
530
531 // Groups and rows
532 iconTile: { width: 32, height: 32, borderRadius: 10, alignItems: 'center', justifyContent: 'center' },
533 card: { borderRadius: 20, borderWidth: 1, overflow: 'hidden' },
534 section: { marginTop: 26 },
535 sectionTitle: { fontSize: 13, fontWeight: '600', letterSpacing: 0.5, marginLeft: 16, marginBottom: 8 },
536 sectionFooter: { fontSize: 13, lineHeight: 18, marginHorizontal: 16, marginTop: 8 },
537 rowRule: { height: 1, marginLeft: 58 },
538 row: { minHeight: 52, flexDirection: 'row', alignItems: 'center', gap: 12, paddingHorizontal: 14 },
539 rowLabel: { flex: 1, fontSize: 16, fontWeight: '500' },
540 rowValue: { fontSize: 15 },
541 signOut: { flex: 1, fontSize: 16, fontWeight: '600' },
542 version: { marginTop: 22, textAlign: 'center', fontSize: 13 },
543
544 // Switch
545 switch: { width: 51, height: 31, borderRadius: 16, padding: 2 },
546 switchThumb: { height: 27, borderRadius: 14, backgroundColor: '#FFFFFF', shadowColor: '#000', shadowOpacity: 0.22, shadowRadius: 3, shadowOffset: { width: 0, height: 2 } },
547
548 // Appearance
549 appearance: { paddingHorizontal: 14, paddingTop: 11, paddingBottom: 14, gap: 12 },
550 appearanceHead: { flexDirection: 'row', alignItems: 'center', gap: 12 },
551 segmented: { borderRadius: 12, padding: 3 },
552 segments: { flexDirection: 'row', height: 36 },
553 segThumb: { position: 'absolute', top: 0, bottom: 0, width: `${100 / MODES.length}%`, borderRadius: 9 },
554 // A shadow's props stay together in one style object: React Native Web builds the shadow per object.
555 segThumbShadowLight: { shadowColor: '#000', shadowOpacity: 0.1, shadowRadius: 4, shadowOffset: { width: 0, height: 1 } },
556 segThumbShadowDark: { shadowColor: '#000', shadowOpacity: 0.4, shadowRadius: 4, shadowOffset: { width: 0, height: 1 } },
557 segment: { flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 6 },
558 segmentLabel: { fontSize: 14 },
559
560 // Profile
561 profile: { flexDirection: 'row', alignItems: 'center', gap: 14, padding: 14, borderRadius: 20, borderWidth: 1 },
562 avatar: { width: 58, height: 58, borderRadius: 29 },
563 profileText: { flex: 1, gap: 3 },
564 profileNameRow: { flexDirection: 'row', alignItems: 'center', gap: 8 },
565 profileName: { flexShrink: 1, fontSize: 18, fontWeight: '700', letterSpacing: -0.3 },
566 plan: { flexDirection: 'row', alignItems: 'center', gap: 3, height: 20, paddingHorizontal: 7, borderRadius: 10 },
567 planLabel: { color: ON_ACCENT, fontSize: 11, fontWeight: '800', letterSpacing: 0.4 },
568 email: { fontSize: 14.5 },
569
570 // Storage
571 storageSlot: { marginTop: 12 },
572 storage: { padding: 14, gap: 14 },
573 storageHead: { flexDirection: 'row', alignItems: 'center', gap: 12 },
574 storageTitle: { fontSize: 16, fontWeight: '600' },
575 storageUsed: { fontSize: 13.5, marginTop: 1 },
576 manage: { height: 32, paddingHorizontal: 13, borderRadius: 16, justifyContent: 'center' },
577 manageLabel: { fontSize: 14, fontWeight: '600' },
578 meter: { height: 8, borderRadius: 4, overflow: 'hidden' },
579 meterFill: { height: 8, flexDirection: 'row', gap: 2, borderRadius: 4, overflow: 'hidden' },
580 legend: { flexDirection: 'row' },
581 legendItem: { flex: 1, gap: 2 },
582 legendKey: { flexDirection: 'row', alignItems: 'center', gap: 6 },
583 legendDot: { width: 8, height: 8, borderRadius: 4 },
584 legendLabel: { fontSize: 12.5 },
585 legendValue: { fontSize: 14, fontWeight: '600', marginLeft: 14 },
586});

More screens like this.

All Profile & Settings