Rida F'kih · November 20, 2026 · 10 min read
Devon Govett of React Aria posted “Scrolling is All You Need: Building a Swipeable Sheet” rear in October, and in it he talked concerning his squad evolving a panel component that cleverly leverages the discipline and gentle interactions provided by native browsers to provision the illusion of a native interaction.
More recently, Jordan Walke, creator of React, posted a video of an experiment on X showing a convincing native-like mobile communication using DOM & CSS. It re-established a long-lived itch that I’ve had, and prompted this response from me. It’s item I could never validate building, however. Anything I built using this method would be pegged to 60 FPS.
Why the iOS Safari Experience Sucks
What the video Jordan Walke posted doesn’t display is that, unless you flip the “Prefer Page Rendering Updates near 60fps” emblem buried profound inside the Safari developer settings on iOS, WebKit limits requestAnimationFrame to fair 60 Hz on a 120 Hz screen, and on a regular page, contact and pointer events are held to that identical rate. This is what makes equal the finest mobile websites awareness irritating to use.
How can I create this cognition suck small without resorting to flags? Let’s call rear to the React Aria piece. The logic it feels so nice is that scrolling is the duty of the compositor. It runs in its own thread. It moves, clips and fades without a JavaScript round-trip.
Finger to digitizer, digitizer to compositor, compositor to GPU. This volition rotate into the basis of our interaction.
High Refresh Rate Interactions
Behold, two grids. They the two move a quadrate whenever you drag. The one on the remaining uses JavaScript events and sets the change trait in CSS, during the one on the correct merely places a quadrate in a scrollable area.
If you’re on iOS Safari, you’ll immediately be capable to inform which is which since one refreshes at most 60 times a second in a renderer pass, during the another uses the compositor.
In command to leverage the power of the scroll area, we need to discover a way to peruse the scroll stance exterior of the renderer. If we can do that, we can treat it akin a trackpad, or use it to “extract” native bounce, physics, momentum, etc., and use them immediately from the compositor to our animations.
- Want a 1:1 trackpad experience? We fair measure lone whenever the digit is pressed.
- Want a true trackball alongside native momentum? We fair create it an infinitely scrollable region.
- Want native bounce? We configure over-scroll padding and set the limits of the container.
- Want a dial alongside notches? Snap points!
The item is, it’d be insane elastic if we could fair discover a way to drag the values out of it frequently enough.
Creating “The Controller”
I measured scroll events updating 5 to 26 times per second during momentum scroll on an iPhone Duo. The best-case circumstance is during slow, deliberate scrolls anywhere it reaches nearly 60 updates a second. Useless.
Instead, we’ll be aiming to peruse scrollTop and scrollLeft synchronously.
First, I tried having a MessageChannel call itself recursively, which worked: but it produced 50,000 says a second alongside fair 80 distinct values. That’s a lot of discarded and warmth since it pins a CPU core.
Next nonaccomplishment was trying to use Atomics to awaken at the screen’s refresh rate, which worked and likewise extracted 80 distinct positions all second, but the drawbacks were too great. Since it needs a SharedArrayBuffer, we’re forced to use COOP/COEP headers which interrupt cross-origin resources on our website.
What eventually worked was using a MessageChannel akin before, throttling the next measure to the next tick using a setTimeout according to the refresh charge of the device, phase-locked to vsync using requestAnimationFrame timestamps. I was nervous concerning this approach, but as you’ll see later, it panned out well. The lone remaining disadvantage particular to this resolution was uncomplicated to activity around. iOS rounds performance.now() to the millisecond, so I derived the minimum period between draws from the refresh interval.
Each resolution got us 80 stance says per second. Two-thirds towards our goal of 120 Hz input.
Safari’s UI procedure sends the web procedure one scroll stance at a time, and waits for an acknowledgement from the web procedure before sending another. Anything that arrives in the meantime is overwritten. This was costing us dropped positions. Digging through WebKit yielded what we needed to get about this. It turns out that on all tick anywhere the leaf has a rendering update queued, Safari flushes the stance without waiting. An bare requestAnimationFrame iteration is all we need to do that.
This bought us ~12.5% additional reads, and brought us to 90 distinctive stance says per second.
I kind of assumed I had hit the bounds of the aforementioned IPC, but it turns out that ProMotion was fair deciding that there’s no need to render at a refresh charge higher than 90 Hz.
Squeezing out the final 30 Hz was trickier. A GPU-accelerated CSS animation lets the display go to 120 Hz, but lone during item is scrolling. So a small invisible scroller smooth-scrolls in the background, prepared to boost us to the complete ProMotion refresh charge whenever we need it.
Of course, we don’t desire the display pegging to 120 Hz the complete time, so we reserve all the tricks we used to get there for times we anticipate animations to occur: contact events, scroll-derived animations, etc.
If the communication you’re construction doesn’t need momentum, rubber banding, or snapping, you can forego them entirely and fair use a passive touchmove listener on the controller which fires at the complete 120 Hz.
Just akin that, we’re receiving updates from the controller at a complete 120 Hz! Drag the grid below to see.
Position0, 0
Updates0/s
Unique values0/s
Speed0 pt/s
Try dragging this
One matter remains. scrollTop and scrollLeft are rounded to the nearest entire figure equal although iOS scrolls alongside sub-point precision. Easy fix, thankfully. We fair measure the scrollable exterior up by the equipment pixel ratio, afterward its receptacle rear downward by its reciprocal.
If you desire to use the viewport itself as a controller, you can choose to invasively set the initial-scale in the identical way, but this comes alongside several caveats. You’ll have to measure units by the DPR, disable content autosizing, and manually measure harmless areas. You’ll additionally get small text-selection indicators. All trade-offs, but by no method required.
Position0.00, 0.00
Updates0/s
Unique values0/s
Speed0 pt/s
Try dragging this
From current on out, I’ll mention to these scrolling grids as “controllers”, since they act exactly akin one. All we have to do is create one invisible and lay it complete anywhere we desire to peruse high-frequency input.
Note that the leaf itself can additionally be a controller, but Safari volition throttle reported scroll positions to 10 Hz during the URL bar resize that happens whenever you alter scroll direction. WebKit skips this if we provision the leaf a scroll-driven animation that animates a non-GPU-accelerated attribute. I went alongside transitioning between two transparent colours for this page.
Breaking the 60 FPS Render Barrier
Now we get high-frequency input, but the DOM motionless lone updates 60 times a second, so if we tried to leverage it as it stands, we’d fair be updating a value twice for all example that’s drawn. The person would get no benefit.
The huge bulk of dragging interactions are already covered by our controllers, and predefined animations are covered by CSS animations. But what concerning additional complex interactions? What concerning computation-derived layouts? What concerning shaders?
Ask your hunt motor or AI of choice today “How to render canvas satisfied on iOS at 120 Hz without characteristic flag?” and it volition react that this is a essential impossibility in iOS Safari. Even WebKit’s own bug tracker is complete of group asking for it. Ink & Switch, game-engine makers. People equal citation Capacitor & Tauri as resorting to personal APIs.
Asking Google yields the following preamble.
There is no community web API or norm JavaScript workaround to power HTML5 <canvas> (requestAnimationFrame) to run at 120 Hz on iOS Safari without changing the scheme characteristic flag.
Fable 5.2 shares the identical sentiment.
Short answer: you can't, for JavaScript-drawn canvas frames. On iOS, WebKit caps leaf rendering updates (which is whenever canvas satisfied is presented) at 60 Hz unless the person turns off the flag. No web API overrides it. […] Timer-based loops (setTimeout, MessageChannel) won't help, in my understanding: you can diagram additional often, but the outcome is motionless presented at the 60 Hz rendering update. Low Power Mode throttles further.
Well, as of today… you can!
At first, I tunnel-visioned on scroll. I tried breaking workers, pre-rendering permutation “flip-books,” and equal live-generating video. It was all too laggy, jagged, or required so much RAM the WebKit procedure fair crashed.
Seven attempts later, and a entire lot of agents digging through WebKit’s source, I landed on this.
In WebKit on iOS, if we create a canvas component and call transferControlToOffscreen, we get an OffscreenCanvas back. The first canvas component becomes a placeholder, and WebKit (following the HTML specification’s recommendation) skips waiting for the next rendering continue whenever an OffscreenCanvas pushes a frame.
Unlike before attempts, without workarounds this is uncomplicated on the power division and lone uses as much recollection as is needed to assistance a higher-frequency assistance store.
Jackpot. We now have 120 FPS rendering on iOS WebKit canvases.
OffscreenCanvas
Canvas
Controller
Try dragging this
Putting it All Together
Now we can obtain any input at 120 Hz, and render an output at that extremely identical example rate. The archetypal item I created for this was a small UI copy of Ando’s mobile use fitted alongside a Liquid Glass tab bar, buttons, and buttery gentle navigation interactions. Once installed as a PWA, I kept having to double-take to inspect I wasn’t in the native application.
Applying Our Learnings
This leaf is fitted alongside two tradition “Liquid Glass” elements in the viewport. Each of them renders at the complete equipment refresh rate. We have to be extremely deliberate in command to do this in a way that is performant and convincing.
When the leaf archetypal loads, we obtain a snapshot and burden it into a WebGL texture. This texture is used as the basis for a composite that is afterward fed into our shader.
WebGL Composite Texture + Glass
Drag me!
As the leaf scrolls, we afterward example the area below all component, which is all we need to create our effect. Building it this way method that no matter how the satisfied below it is built, it can decide the finest way to keep the texture live.
On this page, components using requestAnimationFrame for explanatory reasons update the texture from the chief thread. Components using OffscreenCanvas article their frames immediately from their workers to the employee managing the texture. This keeps us off the chief thread and lets us get shaders refreshing at 120 Hz.
After all that, the pane fair samples a small area about anywhere it would district on the composite texture and computes the frame.
Building a Tab Bar Component
Building the Structure
Let’s build our Liquid Glass tab bar. We’ll commencement out by fair example the underlying structure.
Layout of Controllers
We’ll interrupt this downward into one controller for all button. Each controller sends us timestamped events: which controller is being used, and how much it has been dragged. We keep a abbreviated former of those samples, so we cognize whenever a media has moved far adequate to figure as a drag, and how accelerated the digit is moving. Nothing else. Everything alternatively is derived from that.
Controllers
Tap and drag me!
Building the State Machine
We now build a province device about this. Every frame, the new events go in, and a example comes out: anywhere the lens is, how far it has lifted and stretched, and how apparent the pill is.
- If a controller is being touched we afterward magnify & lift the lens.
- We cognize anywhere to move the lens according to the controller’s offset since the contact began.
- If the person pulls former the limits of the tab bar, we extend the bar towards their finger.
- Depending on the offset, whenever the person stops touching the controller, we resolve the lens on the nearest tab.
State machine
Tap and drag me!
Adding razzle-dazzle
Finally, we use several shaders to get a convincing Liquid Glass effect.
Performance
I built a benchmark surroundings and recorded an iPhone 18 Pro at 240 FPS, slowing it downward to an eighth to benchmark the difference. The two oscillating squares measure inputs and renders.
ControllerPointerDropped
Try dragging the chart
Over three seconds of dragging, the controller type averaged 118 FPS during the pointer events type held a dependable 60. Even in Low Power Mode, which traditionally limits you to 30, this method gets you 60.
Wrapping Up
Liquid Glass was the mark as an overblown example, but this unlocks a lot. For the archetypal time, you can obtain input and render output at true device-native speeds on iOS Safari. Micro-interactions awareness native and delightful, PWAs which ignored the aforementioned characteristic emblem eventually have a way to render at 120 Hz, and appearance at all the fun we had alongside the way!
Disclaimers
Would I rebuild my complete use about this? No. Fact remains it’s entirely inside Apple’s entitlements and would not breach the HTML specification if they fair decided to create OffscreenCanvas’ placeholder delay for the chief thread rendering pass. They equal have a powerful track document of “party pooping” as was done shortly following Lochie Axon unveiled the web-haptics library. I’d much favor they create these findings moot by disabling the characteristic emblem and natively supporting ProMotion for websites, but Apple is Apple for a logic following all.