Online to Offline Status Component
Tuesday, July 8, 2025
demos
online-offline
An ongoing collection of React Native animations crafted with Reanimated, Gesture Handler, and Skia.
TypeScript
3.2k
296
A React Native component that displays user avatars grouped by online/offline status. When users change status, their avatar smoothly animates to the appropriate group.
What it does
The component shows two groups of user avatars side by side. Online users appear on the left with full color photos, while offline users are shown on the right in grayscale. Each group has a subtle background pill that resizes as users move between states.
When a user's status changes, their avatar slides from one group to the other with a spring animation. The component handles all the layout calculations and animations automatically.
Demo
Tap anywhere on the screen to see a random user change their status. The selected avatar will move to its new group and the grayscale filter will fade in or out accordingly.
Technical details
Built with React Native, React Native Reanimated for animations, and React Native Skia for the grayscale color filter.
You should probably avoid using Skia for rendering images in this specific case, as it requires multiple canvases.
A more practical approach would be to use expo-image with a native grayscale filter (for example, react-native-color-matrix-image-filters). However, you won't get the smooth color interpolation effect while transitioning between online and offline states (which is something I really cared about in this demo ๐
).
Since I wanted animations that are quick to test in development mode, I opted for Skia as it works perfectly with Expo Go. In a production app, I would probably use the expo-image approach.
Unlock the beauty of React Native animations
Learn Reanimated, Gesture Handler & Skia with Reanimate.dev
Feedback on Online Offline
Ideas, bugs, or anything that felt off: I read every message. For anything else, write to hello@reactiive.io.
Send feedback