Skip to main content

TouchableNativeFeedback

On Android, this touchable draws the system ripple. On iOS, React Native shows no feedback, and the press works as on TouchableWithoutFeedback. The web does the same as iOS.

import { Text, TouchableNativeFeedback, View } from 'react-native'

const ripple = TouchableNativeFeedback.Ripple('#2563eb', false)

export function Item({ onOpen }) {
return (
<TouchableNativeFeedback role="button" background={ripple} onPress={onOpen}>
<View>
<Text>Open</Text>
</View>
</TouchableNativeFeedback>
)
}

The child gets the press handlers and the accessibility props, as with TouchableWithoutFeedback.

Props​

PropOn the web
background, useForegroundAndroid only. Accepted and ignored, as on iOS.
The props of TouchableWithoutFeedbackAs on TouchableWithoutFeedback.
hasTVPreferredFocus, nextFocusDown and othersTV only. Accepted and ignored.

Static methods​

MethodOn the web
SelectableBackground(rippleRadius?)Returns the same object as on native, for background.
SelectableBackgroundBorderless(rippleRadius?)Returns the same object as on native, for background.
Ripple(color, borderless, rippleRadius?)Returns the same object as on native, with the color from processColor.
canUseNativeForeground()false, as on iOS.
The React Compiler lint and Ripple

The React Compiler lint reads a capitalized call in a component, such as TouchableNativeFeedback.Ripple(...), as a component, and reports capitalized-calls. Make the call once outside the component, as in the example.