<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/drag-to-sort-react-native-gestures-and-animations-hxjliy7zz" -->

---
title: Drag to Sort — React Native Gestures and Animations
description: A walkthrough of building a drag-to-sort interaction in React Native using Reanimated and gesture handlers. Cards are absolutely positioned with shared value...
canonical: https://daily.dev/posts/drag-to-sort-react-native-gestures-and-animations-hxjliy7zz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Drag to Sort — React Native Gestures and Animations | daily.dev
og:description: A walkthrough of building a drag-to-sort interaction in React Native using Reanimated and gesture handlers. Cards are absolutely positioned with shared value...
og:url: https://daily.dev/posts/drag-to-sort-react-native-gestures-and-animations-hxjliy7zz
og:image: https://api.daily.dev/og/posts/hXjLiY7zZ.png
og:image:alt: Drag to Sort — React Native Gestures and Animations
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Drag to Sort — React Native Gestures and Animations

**[William Candillon](https://daily.dev/sources/wcandillon)** · 26 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of building a drag-to-sort interaction in React Native using Reanimated and gesture handlers. Cards are absolutely positioned with shared value offsets on the y-axis. When a card is dragged, its current position is used to calculate a new offset index, and the displaced card's offset is swapped. Active cards get a z-index boost and a scale animation. Non-active cards use a derived value to spring to their new positions when offsets change. The tutorial covers pan gesture setup, context-based offset tracking, z-index management with a shared activeCard value, and the core offset-swapping logic.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=xty5Rsnyqpk>

---

Tags: [#react-native](https://daily.dev/tags/react-native)

[View this post on daily.dev](https://daily.dev/posts/drag-to-sort-react-native-gestures-and-animations-hxjliy7zz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Drag to Sort — React Native Gestures and Animations","url":"https://daily.dev/posts/drag-to-sort-react-native-gestures-and-animations-hxjliy7zz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/drag-to-sort-react-native-gestures-and-animations-hxjliy7zz"},"datePublished":"2026-06-17T14:03:57.640Z","dateModified":"2026-06-17T14:05:01.385Z","description":"A walkthrough of building a drag-to-sort interaction in React Native using Reanimated and gesture handlers. Cards are absolutely positioned with shared value...","image":"https://i.ytimg.com/vi/xty5Rsnyqpk/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/xty5Rsnyqpk/sddefault.jpg","isAccessibleForFree":true,"articleSection":"William Candillon","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"William Candillon","logo":"https://media.daily.dev/image/upload/s--3vvpMuQN--/f_auto/v1747295211/logos/wcandillon","url":"https://daily.dev/sources/wcandillon"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/drag-to-sort-react-native-gestures-and-animations-hxjliy7zz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"react-native","timeRequired":"PT26M","video":{"@type":"VideoObject","name":"Drag to Sort — React Native Gestures and Animations","description":"A walkthrough of building a drag-to-sort interaction in React Native using Reanimated and gesture handlers. Cards are absolutely positioned with shared value...","thumbnailUrl":"https://i.ytimg.com/vi/xty5Rsnyqpk/sddefault.jpg","uploadDate":"2026-06-17T14:03:57.640Z","duration":"PT26M","url":"https://api.daily.dev/r/hXjLiY7zZ","embedUrl":"https://www.youtube.com/embed/xty5Rsnyqpk"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"William Candillon","item":"https://daily.dev/sources/wcandillon"},{"@type":"ListItem","position":3,"name":"Drag to Sort — React Native Gestures and Animations"}]}
```

