UNPKG

1.52 kBMarkdownView Raw
1# react-native-material-ripple
2
3Base component for touchable elements
4
5![Example](https://cloud.githubusercontent.com/assets/2055622/23309410/a363975a-fabf-11e6-8cd8-b9c5cca76b63.gif)
6
7## Installation
8
9```bash
10npm install --save react-native-material-ripple
11```
12
13## Usage
14
15```javascript
16import React, { Component } from 'react';
17import { Text } from 'react-native';
18import Ripple from 'react-native-material-ripple';
19
20export default class Example extends Component {
21 render() {
22 return (
23 <Ripple onPress={ () => null }>
24 <Text>touch me</Text>
25 </Ripple>
26 );
27 }
28}
29```
30
31## Properties
32
33* `rippleColor` - Ripple color (default: black)
34* `rippleOpacity` - Ripple opacity (default: 0.2)
35* `rippleDuration` - Ripple duration in ms (default: 400)
36* `rippleSize` - Ripple size restriction (default: 0)
37* `rippleContainerBorderRadius` - Ripple container border radius (default: 0)
38* `disabled` - Ripple should ignore gestures (default: false)
39* `onPressIn` - Touch moved in or started callback
40* `onPressOut` - Touch moved out or terminated callback
41* `onPress` - Touch up inside bounds callback
42
43## Example
44
45```bash
46git clone https://github.com/n4kz/react-native-material-ripple.git
47cd react-native-material-ripple/example
48npm install
49react-native run-ios # or run-android
50```
51
52## Copyright and License
53
54BSD License
55
56Copyright 2017 Alexander Nazarov. All rights reserved.