Home / Companies / LogRocket / Blog / Post Details
Content Deep Dive

React Native touchable vs. pressable components

Blog post from LogRocket

Post Details
Company
Date Published
Author
Shalitha Suranga
Word Count
3,494
Language
-
Hacker News Points
-
Summary

Modern smartphones have transitioned to touch screens with various hand gesture features, and React Native, a popular framework for building mobile applications, has evolved to support these gestures through components like Touchable and Pressable. Initially, React Native offered platform-specific buttons and touchable components such as TouchableOpacity, TouchableHighlight, TouchableWithoutFeedback, and TouchableNativeFeedback, which allowed developers to create interactive UI elements with built-in feedback animations like opacity changes or Android's ripple effect. However, these components had limitations in customization and animation effects. To address this, React Native introduced the Pressable component with the Pressability API, enabling developers to create highly customizable feedback animations without predefined constraints. The Pressable component provides flexibility for complex UIs and animations, although it requires additional effort to implement compared to touchable components. While touchable components are still widely used and recommended for simpler implementations, React Native encourages developers to adopt the Pressable component for new applications to take advantage of its extensive customization capabilities.