UNPKG

1.41 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` - Border radius for ripple container (default: 0)
38
39## Callbacks
40
41* `onPressIn` - Called when component receives touch
42* `onPressOut` - Called when component looses touch
43* `onPress` - Called on touch up in component bounds
44
45## Example
46
47```bash
48git clone https://github.com/n4kz/react-native-material-ripple.git
49cd react-native-material-ripple
50npm install
51react-native run-ios # or run-android
52```
53
54## Copyright and License
55
56BSD License
57
58Copyright 2017 Alexander Nazarov. All rights reserved.