Overview
Uniwind Pro provides animated theme transitions when switching between themes at runtime. The transition creates a snapshot overlay of the current screen before the theme changes, then animates that overlay away to reveal the new theme underneath.Switching themes has never been this smooth. Uniwind Pro handles theme transitions on the native side, offering you multiple transition strategies out of the box.
Usage
API Reference
setTheme(themeName, transition?)
The name of the theme to switch to (e.g.,
'light', 'dark', or a custom theme name).Optional transition configuration. If omitted, the theme changes instantly without animation.
Available Presets
| Preset | Value | Description |
|---|---|---|
ThemeTransitionPreset.None | 0 | No animation, instant theme change |
ThemeTransitionPreset.Fade | 1 | Fade out animation |
ThemeTransitionPreset.SlideRightToLeft | 2 | Sliding mask animation from right to left |
ThemeTransitionPreset.CircleTopRight | 3 | Circular reveal expanding from top-right corner |
How It Works
The transition animation happens in two phases:-
Prepare Phase - When
setThemeis called with a transition, the native layer captures a bitmap/snapshot of the current screen and places it as an overlay on top of the view hierarchy - Animate Phase - The app switches themes while the overlay hides the change. The overlay then animates away (fading, sliding, or revealing) to show the fully-themed new state underneath. After the animation completes, the overlay is removed from the view hierarchy
Perfect Shadow Tree Synchronization
Uniwind Pro synchronizes theme updates across the shadow tree, native components, and React re-renders, all in a single frame. Uniwind Pro achieves single-frame perfection by:- Updating the native shadow tree directly without waiting for React reconciliation
- Coordinating appearance changes (light/dark mode) with style updates atomically
- Using the snapshot overlay to hide any micro-delays, ensuring users see only the smooth animated reveal of the fully-themed new state
Native Implementation
- iOS
- Android
- Uses
UIView.snapshotView(afterScreenUpdates:)for the overlay - Animates with
CABasicAnimationandCAShapeLayermasks - Overrides appearance via
window.overrideUserInterfaceStyle
Important Notes
OS-level theme transitions are not affected
OS-level theme transitions are not affected
This only animates Uniwindโs in-app theme changes. The system dark/light mode transition (triggered by Control Center or Settings) happens instantly at the OS level before the app receives the notification, so users wonโt see that transition regardless.
Fixed animation duration
Fixed animation duration
Animation duration is fixed at 500ms with ease-in-ease-out timing on both platforms.
Future API extensions
Future API extensions
Additional presets, customizable duration, and easing options are planned for future releases.