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
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.
-
Dark mode Night falls from the top. -
Unlock Pro From the Buy button. -
Switch language English to 日本語. -
Reveal a balance From the eye button. -
Change tabs From the tapped tab.
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.
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