Glass Transitions
Glass Transitions
React NativeiOS

Glass Transitions

Animate any state change in your React Native app with a lens of glass that sweeps across the screen.

The old screen bends, blurs and splits into color at the edge of the glass. The new one settles in behind it. Night falls from the top, day rises from the bottom.

npx expo install react-native-glass-transitions

iOS · Expo · Skia

The example app's settings screen in light mode

Tap to switch. Drag to pull the glass.

Use cases

Not just dark mode.

Wrap any state change. The glass starts from the control that caused it.

How it works

Wrap the change. That’s it.

One provider at the root. One call where your state changes.

App.tsx
import {
  GlassTransitionProvider,
  useGlassTransition,
} from 'react-native-glass-transitions';

// Once, at the root.
<GlassTransitionProvider preset="glass">
  <App />
</GlassTransitionProvider>

// Anywhere inside.
const { transition } = useGlassTransition();
transition(() => setTheme('dark'));
  • The tapped control stays live.
  • Night falls, day rises. Automatically.
  • Drag the glass with useGlassScrub.
  • Four presets and a live tuner.
  • Haptics, Reduce Motion and status bar, handled.
  • A Skia shader on the UI thread.
Past halfway, it commits.

Get started

Install. Wrap. Done.

iOS · Expo dev build · Skia · Reanimated 4

Terminal
npx expo install react-native-glass-transitions @shopify/react-native-skia react-native-reanimated react-native-worklets expo-haptics
Usage
<GlassTransitionProvider>{children}</GlassTransitionProvider>
const { transition } = useGlassTransition();
transition(() => setTheme('dark'));

Free and open source. If Glass Transitions saved you time, you can buy me a coffee