# Visual Effects ## Backdrop Blur Use `expo-blur` for blur effects. Prefer systemMaterial tints as they adapt to dark mode. ```tsx import { BlurView } from "expo-blur"; ; ``` ### Tint Options ```tsx // System materials (adapt to dark mode) // Basic tints // Prominent (more visible) // Extra light/dark ``` ### Intensity Control blur strength with `intensity` (0-100): ```tsx // Subtle // Full ``` ### Rounded Corners BlurView requires `overflow: 'hidden'` to clip rounded corners: ```tsx ``` ### Overlay Pattern Common pattern for overlaying blur on content: ```tsx Caption ``` ## Glass Effects (iOS 26+) Use `expo-glass-effect` for liquid glass backdrops on iOS 26+. ```tsx import { GlassView } from "expo-glass-effect"; Content inside glass ``` ### Interactive Glass Add `isInteractive` for buttons and pressable glass: ```tsx import { GlassView } from "expo-glass-effect"; import { SymbolView } from "expo-symbols"; import { colors } from "@/theme/colors"; ``` ### Glass Buttons Create liquid glass buttons: ```tsx function GlassButton({ icon, onPress }) { return ( ); } // Usage ``` ### Glass Card ```tsx Card Title Card content goes here ``` ### Checking Availability Check both guards: `isLiquidGlassAvailable()` (OS support) and `isGlassEffectAPIAvailable()` — some iOS 26 beta versions lack the API and crash without the second check. ```tsx import { isLiquidGlassAvailable, isGlassEffectAPIAvailable } from "expo-glass-effect"; const canUseGlass = isLiquidGlassAvailable() && isGlassEffectAPIAvailable(); ``` ### Fallback Pattern ```tsx import { GlassView, isLiquidGlassAvailable, isGlassEffectAPIAvailable } from "expo-glass-effect"; import { BlurView } from "expo-blur"; function AdaptiveGlass({ children, style }) { if (isLiquidGlassAvailable() && isGlassEffectAPIAvailable()) { return {children}; } return ( {children} ); } ``` When the user has Reduce Transparency enabled (`AccessibilityInfo.isReduceTransparencyEnabled()`), skip glass *and* blur — render a solid `colors.systemBackground` surface instead. ## Sheet with Glass Background Make sheet backgrounds liquid glass on iOS 26+: ```tsx ``` ## Best Practices - Use `systemMaterial` tints for automatic dark mode support - Always set `overflow: 'hidden'` on BlurView for rounded corners — but never on a `GlassView` or its ancestors: glass clips itself via `borderRadius` (+ `borderCurve`), and outside clipping cuts off the rim highlight and press bulge - Use `isInteractive` on GlassView only for actual controls (buttons, pressables) — leave background surfaces non-interactive - Check `isLiquidGlassAvailable()` **and** `isGlassEffectAPIAvailable()`, provide fallbacks, and respect Reduce Transparency with a solid surface - Never animate opacity on a `GlassView` or an ancestor — animate content around a stable glass surface, or switch `glassEffectStyle` on the mounted view to change its look - Avoid nesting blur views (performance impact) - Keep blur intensity reasonable (50-100) for readability