Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 5 min read How-to mediumAdept

Making Your React Native Gestures Feel Natural

Draggable UI in React Native feels more natural when gesture end-handling accounts for release velocity, not just finger position. Using the Shop app's bottom Sheet as an example, adding a multiplied `velocityY` to the final position lets quick flicks open or close the sheet. Replacing a fixed 600 ms timing animation with `withSpring` makes the settle animation respect distance and momentum. Dividing drag distance when pulling past the open position adds rubber-band resistance that signals the sheet can't go further.

Assumes: React Native basicsgesture handlersanimation APIs

Related posts

  • How We Built the Add to Favorite Animation in Shop

    Shopify Engineering mediumAdept

    Shop's Add to Favorite animation, where a product thumbnail pops in, scales, and drops into a bouncing heart tab-bar icon, is built in React Native with Reanimated by driving the whole sequence from a single shared progress value that steps through 1, 2, 3 and so on, each step with its own duration and easing from the motion spec. Each property (opacity, scale, translateY, icon fill and bounce) is mapped from that progress value with clamped interpolation, and the filled heart is a second icon faded in over the outline. Using one shared value guarantees the icon moves the instant the thumbnail disappears, creating a cinematic match cut. An earlier setTimeout-based approach broke that timing when the JS thread was busy; Reanimated's withDelay keeps the timer on the UI thread.

  • Building Custom Animations in the Workflow Builder

    Slack Engineering mediumAdept

    Slack's Workflow Builder added drag-and-drop from a new steps sidebar into workflows by moving react-beautiful-dnd's DragDropContext to wrap the whole builder page, with two draggable/droppable lists. A custom context provider holds drag state fed by the library's responders. On top of that the team built several workarounds: custom transforms to re-center differently sized steps, DOM-measured dynamic placeholders the library doesn't support, and a velocity-based tilt effect driven by requestAnimationFrame. A key lesson was hiding hint boxes in onBeforeCapture rather than onBeforeDragStart, because only the former runs before the library measures the DOM.

  • Getting Started with React Native Skia

    Shopify Engineering mediumAdept

    React Native Skia (@shopify/react-native-skia) exposes Google's Skia 2D graphics engine to React Native, giving a cartesian canvas with shapes, paths, shaders and image filters that go beyond what View and react-native-svg handle well. The tutorial covers drawing primitives and paths (via SVG strings or imperative commands like addArc), animating drawings by passing Reanimated shared values directly to Skia components, driving them with Gesture Handler pan gestures on the UI thread for 60-120 FPS interaction, and applying built-in effects like Blur and DashPathEffect. Skia also works in the browser through React Native Web.

  • Fluid layout customization with Splits

    Replit mediumAdept

    Replit's Workspace now supports Splits, a tiling layout where tabs, panes and files from the filetree can be dragged onto five hit areas of any pane (header to merge, or four conical-section quadrants to split), plus maximize and float modes. The design favours predictability, learnability and fluidity: explicit state visualization, a visible 50px detach radius, continuous resizing during drag, and few special cases, such as always placing auto-created webviews in the top-right node. To get fluid drag behaviour in React, the team used jotai to skip rerenders during drag state updates and wrote custom low-level mouse handlers instead of using a tiling library. Layout is stored as a multi-node tree of Splits and PaneGroups, which drives resize behaviour and simple placement heuristics.

  • Custom Navigational Transitions in iOS

    Zalando Engineering mediumAdept

    Zalando's iOS app adds a custom zoom-style push transition between backend-driven screens. The tapped outfit card grows into the details view, built on UIKit's UIViewControllerAnimatedTransitioning and a custom navigation delegate. Because the backend-defined UI and the generic deep-link router lack context about the tapped view, the team intercepts the tap to capture its frame and snapshot and passes them through the navigation service. Plain drawHierarchy snapshots pixelated and scaled text badly, so they switched to recursively re-rendering the tapped layout per component, omitting labels and buttons and rendering real image views, which gave crisp transitions reusable across screens.

The quest for software engineering knowledge.

Look:
Layout: