Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

I recreated the iOS list view with React Aria Components and Framer Motion! It has fluid swipe gestures, layout animations, multiple selection mode, and even keyboard support. The code is remarkably small for that much functionality too. Check it out! 🤩

90,027 görüntüleme • 3 yıl önce •via X (Twitter)

10 Yorum

Devon Govett profil fotoğrafı
Devon Govett3 yıl önce

Direct demo link (try it on your phone): And check out GridList from React Aria Components. Aside from the features shown here, it has a bunch more including row actions (e.g. to navigate to detail view) and drag and drop! 🙂

Devon Govett profil fotoğrafı
Devon Govett3 yıl önce

This demo also uses a pretty neat technique IMO: it stores the framer motion value that's controlled by the drag gesture in a CSS variable. Then, other things can be calculated in pure CSS, like the delete button's width.

Devon Govett profil fotoğrafı
Devon Govett3 yıl önce

Getting the text alignment of the delete button to animate when you cross the 80% threshold was also challenging. It swaps justify-content, and then does a keyframe animation using transform to calculate the opposite position. So much simpler than the imperative version I had!

kitze 🚀 profil fotoğrafı
kitze 🚀3 yıl önce

you are the only person who gives me hope about this godforsaken platform

Sam Selikoff profil fotoğrafı
Sam Selikoff3 yıl önce

Very nice work! First thing I checked was whether you could still vertically scroll while tapped on an item. Seems it sometimes locks it but sometimes not (i.e. sometimes you can still scroll the list while an item is being touched). I'm guessing this might be some iOS behavior that's beyond our reach?

Devon Govett profil fotoğrafı
Devon Govett3 yıl önce

I think framer motion is supposed to lock vertical scrolling while the drag gesture is active. That seems to work ok for me. I wish the gesture was a bit less sensitive while you are scrolling though, sometimes a bit of red peeks out. Hard stuff!

Apoorv | Plxity profil fotoğrafı
Apoorv | Plxity3 yıl önce

i had also tried building something like this couple of weeks back

Rohit Gupta profil fotoğrafı
Rohit Gupta3 yıl önce

Amazing work, got inspired after seeing all the features and such smooth animations

Tech Foo profil fotoğrafı
Tech Foo3 yıl önce

you're killing it, react-aria is the next big thing

Taofeeq profil fotoğrafı
Taofeeq3 yıl önce

Damn 😍

Benzer Videolar

Build uncompromising high-performance, high-fidelity apps with React. What you see is not the Apple Messages app, nor is it meant to be 1:1. Rather it serves as an aspirational and real example of UI/UX that is possible. Every detail from the bubble animations to keyboard gestures to scroll view insets and safe areas to parallax timestamps required care and attention. Quality UIs come from caring hard. The little chat bubble tails that morph away when the next message animates in. Timestamps that scroll at a different rate than the bubbles. Peek gestures powered by UIKit that lift a chat bubble, tail and all, with a gentle haptic pulse. The subtle shadow of the text composer and responsively sliding down the keyboard in pixel-perfect concert. The composer shrinking its width to fit iPhone’s rounded bezel. The beautiful Liquid Glass refractions have the level of glassiness chosen by the user (new in iOS 27). Scroll view insets that adjust to fit the home bar and keyboard dynamically, creating a sense of depth as the chat bubbles are slightly visible as they scroll under the keyboard. Keeping the keyboard on screen if the prior screen already presented it. Sliding the keyboard and composer with the screen when the user drags to navigate back. I am excited to explore using the new iPhone Duo view controllers natively with React when the time comes. There is always room for innovation and improvement. This chat demo runs at 120 FPS on iOS 27 even on my phone that’s four versions old now. There are several approaches to high-performance lists. I explored a new Expo scroll view that uses the native gesture systems along with react-native’s VirtualView (codenamed “Fling” to reflect the speed of flinging a scroll view), which Meta’s React team designed to prioritize scroll momentum with React’s scheduler. There are tradeoffs with other scroll strategies for how the scroll views gracefully degrade, and they can be swapped out based on what’s best for your app’s use case. And, by virtue of using modern React, high-priority events like user gestures can preempt lower-priority ones like a network response. Let us dispel any myth that using React requires compromising on beautiful, smooth, user-friendly UI/UX that Uses the Platform. Let us dispel any myth frame-perfect UI coordination is not achievable. The Hermes thread and the UI thread can coordinate when needed, like for controlled text inputs. Let us dispel any myth that React Native’s performance is impacted by a bridge, let alone has a bridge. Bridgeless JSI and the Fabric renderer are here for apps that use the New Architecture. What about Android? The app runs and I’ll share a screenshot from my cloud agent’s emulator. With some attention to detail dedicated to Android I’m confident crafted UX is attainable. I’ve spent my tokens once and have a structural head start everywhere. One more thing! Most of this chat’s application code is written with , , , and other familiar elements. The styling is mostly CSS, including linear-gradient(), background-attachment: fixed, and semantic platform colors that adapt to dark mode. Not just appearance - CSS Animations and CSS Transitions run entirely natively. There are a handful of custom native components written in Swift and Kotlin, like the chat bubbles and a custom CAShapeLayer and UIBezierPath for the tails. Native coding is a first-class feature. The way to think about building beautiful apps this way is React and Native, not React vs. Native. Aspire high and raise your ambitions for what is possible!

James Ide

138,996 görüntüleme • 9 gün önce