SwipeUI
DocsHooks & utilities

useReduceTransparency

Tracks the iOS Reduce Transparency setting, so glass and blur can fall back to solid colours.

Tracks the iOS Reduce Transparency setting, so glass and blur surfaces can fall back to solid colours.

Free (MIT)Version 1.0.0Released 23 Oct 2026iOS and Android

When to use it

  • Choose a solid surface when the user requests reduced transparency.

When not to use it

  • Use motion preferences separately; reduced transparency does not mean reduced motion.

Installation

Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.

npx @swipeui/cli add use-reduce-transparency
  • Adds components/swipeui/hooks/use-reduce-transparency.ts.

Usage

components/toolbar.tsx
import { useReduceTransparency } from '@/components/swipeui/hooks/use-reduce-transparency';

const reduceTransparency = useReduceTransparency();
const glass = Platform.OS === 'ios' && glassAvailable && !reduceTransparency;
// glass: a tinted glass view; otherwise a solid bg-surface-elevated background.

It reads the setting on mount and updates while the app runs.

Gotchas

  • It's always false on Android, which has no such setting.
  • It returns false until the first read completes, a moment after mount.

Accessibility

  • Respect the iOS accessibility preference and provide a solid surface.

Motion

  • Static on its own; any movement comes from the parent that animates it.
  • No custom movement is configured by this item.

Performance

  • Subscribes to the accessibility setting and removes the listener on unmount.

Notes for AI

  • Use this hook for blur/glass fallbacks, not to detect Liquid Glass availability.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items

On this page