Capability Detection
The glass engine detects blur capability at startup and adjusts rendering automatically. Components degrade gracefully on platforms that don't support native blur — you never need to write platform branches yourself.
Capability levels
fulliOSIS_FULL_GLASS = trueFull native blur via expo-blur BlurView. All 8 glass layers render at full fidelity. Glow effects are enabled. This is the target experience.
partialAndroid 12+ / WebIS_PARTIAL_GLASS = trueBlurView renders but at 65% intensity to stay within Android RenderEffect constraints. All diffusion and sheen layers render normally. Glow is disabled.
noneAndroid < 12IS_NO_GLASS = trueBlur is disabled entirely. Surfaces fall back to a solid semi-transparent tint with full diffusion and sheen layers still active, maintaining a premium look without blur cost.
Exported capability flags
Import these constants from reactnatively/glass (or from reactnatively) to branch on capability in your own code:
import {
GLASS_CAPABILITY, // 'full' | 'partial' | 'none'
SUPPORTS_BLUR, // true when capability !== 'none'
IS_FULL_GLASS, // true on iOS
IS_PARTIAL_GLASS, // true on Android 12+ and web
IS_NO_GLASS, // true on Android < 12
} from 'reactnatively/glass';
// Use in layout decisions
if (IS_NO_GLASS) {
// Increase text contrast since there's no blur separation
}adjustBlurForCapability
The engine automatically adjusts blur values using adjustBlurForCapability. Use it yourself if you're calling resolveGlass directly:
import { adjustBlurForCapability } from 'reactnatively/glass';
// full capability → returns intensity unchanged
// partial → returns Math.round(intensity * 0.65)
// none → returns 0
const adjustedBlur = adjustBlurForCapability(54); // elevation 3 blurPlatform summary
| Platform | Capability | Blur method | Blur intensity |
|---|---|---|---|
| iOS | full | expo-blur (UIVisualEffectView) | 100% |
| Android 12+ (API 31+) | partial | expo-blur (dimezisBlurView) | 65% |
| Android < 12 | none | solid tint fallback | 0% |
| Web | partial | CSS backdrop-filter | 65% |