Logo

TouchableRipple

A wrapper for views that should respond to touches. Provides a material "ink ripple" interaction effect for supported platforms (>= Android Lollipop). On unsupported platforms, it falls back to a highlight effect.

Usage

import * as React from 'react';
import { View } from 'react-native';
import { Text, TouchableRipple } from 'react-native-paper';

const MyComponent = () => (
  <TouchableRipple
    onPress={() => console.log('Pressed')}
    rippleColor="rgba(0, 0, 0, .32)"
  >
    <Text>Press anywhere</Text>
  </TouchableRipple>
);

export default MyComponent;

Props

borderless
Type: boolean
Default value: false

Whether to render the ripple outside the view bounds.

background
Type: Object

Type of background drawabale to display the feedback (Android). https://facebook.github.io/react-native/docs/touchablenativefeedback.html#background

centered
Type: boolean

Whether to start the ripple at the center (Web).

disabled
Type: boolean

Whether to prevent interaction with the touchable.

onPress
Type: (e: GestureResponderEvent) => void

Function to execute on press. If not set, will cause the touchable to be disabled.

onLongPress
Type: (e: GestureResponderEvent) => void

Function to execute on long press.

rippleColor
Type: string

Color of the ripple effect (Android >= 5.0 and Web).

underlayColor
Type: string

Color of the underlay for the highlight effect (Android < 5.0 and iOS).

children (required)
Type: React.ReactNode

Content of the TouchableRipple.

style
Type: StyleProp<ViewStyle>
theme
Type: Theme

Static properties

These properties can be accessed on TouchableRipple by using the dot notation, e.g. TouchableRipple.supported.

supported

Whether ripple effect is supported.

Edit this page